Bluetooth: L2CAP: Fix div-by-zero in l2cap_le_flowctl_init()
[sfrench/cifs-2.6.git] / net / bluetooth / sco.c
index e0ad30862ee4142cac48d0538fcec9df6e97b8b2..71d36582d4efa3e9dfdb5d696c4f53e12863525e 100644 (file)
@@ -126,7 +126,6 @@ static void sco_sock_clear_timer(struct sock *sk)
 /* ---- SCO connections ---- */
 static struct sco_conn *sco_conn_add(struct hci_conn *hcon)
 {
-       struct hci_dev *hdev = hcon->hdev;
        struct sco_conn *conn = hcon->sco_data;
 
        if (conn) {
@@ -144,9 +143,10 @@ static struct sco_conn *sco_conn_add(struct hci_conn *hcon)
 
        hcon->sco_data = conn;
        conn->hcon = hcon;
+       conn->mtu = hcon->mtu;
 
-       if (hdev->sco_mtu > 0)
-               conn->mtu = hdev->sco_mtu;
+       if (hcon->mtu > 0)
+               conn->mtu = hcon->mtu;
        else
                conn->mtu = 60;