Skip to content

Commit 5105f3e

Browse files
fourdimgregkh
authored andcommitted
Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_state_change_cb()
commit 2ff1a41 upstream. Add the same NULL guard already present in l2cap_sock_resume_cb() and l2cap_sock_ready_cb(). Fixes: 89bc500 ("Bluetooth: Add state tracking to struct l2cap_chan") Cc: stable@kernel.org Signed-off-by: Siwei Zhang <oss@fourdim.xyz> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ab77c8b commit 5105f3e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

net/bluetooth/l2cap_sock.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,9 @@ static void l2cap_sock_state_change_cb(struct l2cap_chan *chan, int state,
16271627
{
16281628
struct sock *sk = chan->data;
16291629

1630+
if (!sk)
1631+
return;
1632+
16301633
sk->sk_state = state;
16311634

16321635
if (err)

0 commit comments

Comments
 (0)