diff options
author | Nagarjuna Kristam <nkristam@nvidia.com> | 2012-06-19 12:53:06 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:12:29 -0700 |
commit | 698d7bfa6672f799e2076dd7b68595ffebd8fea6 (patch) | |
tree | 603b6300a11a30a889c7dce6e40acb0862d4a67d /net/bluetooth | |
parent | 05e42e759d6f66ced5cd193c9f6d9583328c2c26 (diff) |
net: bluetooth: prevent multiple l2cap_chan_destroy calls
During l2cap channel disconnection, l2cap_chan_destroy is called twice,
when socket is released and when l2cap channel is closed. This causes
kernel panic.
add SOCK_DEAD check inside l2cap_sock_kill to prevent multiple
l2cap_chan_destroy function call
bug 1002888
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Change-Id: I1997ebe21351c034636f7133577a454a9e7bcedf
Reviewed-on: http://git-master/r/109731
Tested-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Rakesh Kumar <krakesh@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Rebase-Id: Ra823d6000bb09141e129df3366b05dc36a54b5b5
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 36fed40c162c..457cfe36eae0 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -844,7 +844,8 @@ done: */ static void l2cap_sock_kill(struct sock *sk) { - if (!sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket) + if (!sock_flag(sk, SOCK_ZAPPED) || sock_flag(sk, SOCK_DEAD) || + sk->sk_socket) return; BT_DBG("sk %p state %s", sk, state_to_string(sk->sk_state)); |