Skip to content

Commit

Permalink
[Bluetooth] Fix HID disconnect NULL pointer dereference
Browse files Browse the repository at this point in the history
The latest HID disconnect sequence change introduced a NULL pointer
dereference. For the quirk to handle buggy remote HID implementations,
it is enough to wait for a potential control channel disconnect from
the remote side and it is also enough to wait only 500 msecs.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Marcel Holtmann authored and David S. Miller committed Oct 20, 2006
1 parent 8602b4f commit 7b19ffc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/bluetooth/hidp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,10 @@ static int hidp_session(void *arg)

hidp_del_timer(session);

if (intr_sk->sk_state != BT_CONNECTED)
wait_event_timeout(*(ctrl_sk->sk_sleep), (ctrl_sk->sk_state == BT_CLOSED), HZ);

fput(session->intr_sock->file);

wait_event_timeout(*(intr_sk->sk_sleep), (intr_sk->sk_state == BT_CLOSED), HZ);
wait_event_timeout(*(ctrl_sk->sk_sleep),
(ctrl_sk->sk_state == BT_CLOSED), msecs_to_jiffies(500));

fput(session->ctrl_sock->file);

Expand Down

0 comments on commit 7b19ffc

Please sign in to comment.