Skip to content

Commit

Permalink
Bluetooth: Fix crash when monitor timeout expires
Browse files Browse the repository at this point in the history
The code was crashing due to a invalid access to hci_conn after the
channel disconnect.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Gustavo F. Padovan authored and Marcel Holtmann committed May 10, 2010
1 parent f6e6b16 commit 0ee0d20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 0ee0d20

Please sign in to comment.