bluetooth: Check for hcon during during sock_close

It is possible that during BT OFF operation the hcon
could be released from a tasklet context while we are
trying to send the l2cap disconnect req. Make sure
that hcon is valid before dereferencing it during
l2cap disconnect req.

CRs-fixed: 383345
Change-Id: Icb12c62560013b5ebb047c1c5d4bfe04b3a793ef
Signed-off-by: Sunny Kapdi <sunnyk@codeaurora.org>
This commit is contained in:
Sunny Kapdi 2012-07-27 16:19:43 -07:00 committed by Stephen Boyd
parent 3215d227ff
commit 30ff7fbdaf

View file

@ -701,6 +701,9 @@ void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *d
if (!skb)
return;
if (conn->hcon == NULL || conn->hcon->hdev == NULL)
return;
if (lmp_no_flush_capable(conn->hcon->hdev))
flags = ACL_START_NO_FLUSH;
else