Skip to content

Commit

Permalink
Bluetooth: Do not dereference zero sk
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
Andrei Emeltchenko authored and Johan Hedberg committed Feb 16, 2012
1 parent 46479e6 commit 7ddb6e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/bluetooth/l2cap_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,14 +795,16 @@ static void l2cap_sock_kill(struct sock *sk)
static int l2cap_sock_shutdown(struct socket *sock, int how)
{
struct sock *sk = sock->sk;
struct l2cap_chan *chan = l2cap_pi(sk)->chan;
struct l2cap_chan *chan;
int err = 0;

BT_DBG("sock %p, sk %p", sock, sk);

if (!sk)
return 0;

chan = l2cap_pi(sk)->chan;

lock_sock(sk);
if (!sk->sk_shutdown) {
if (chan->mode == L2CAP_MODE_ERTM)
Expand Down

0 comments on commit 7ddb6e0

Please sign in to comment.