From: Gustavo F. Padovan Date: Sat, 1 May 2010 19:15:41 +0000 (-0300) Subject: Bluetooth: Fix crash when monitor timeout expires X-Git-Tag: v2.6.35-rc1~473^2~199 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=0ee0d20855ae9271de3f6695f4cafc08ab2533bb;p=~emulex%2Finfiniband.git Bluetooth: Fix crash when monitor timeout expires The code was crashing due to a invalid access to hci_conn after the channel disconnect. Signed-off-by: Gustavo F. Padovan Reviewed-by: João Paulo Rechi Vita Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 4c7b2d22faa..2f9bbad4288 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -1568,6 +1568,9 @@ static struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *m BT_DBG("sk %p len %d", sk, (int)len); + if (!conn) + return ERR_PTR(-ENOTCONN); + if (sdulen) hlen += 2;