Skip to content

Commit

Permalink
Bluetooth: Put HCI device if inquiry procedure interrupts
Browse files Browse the repository at this point in the history
Jump to the label done to decrement the reference count of HCI device
hdev on path that the Inquiry procedure is interrupted.

Fixes: 3e13fa1 ("Bluetooth: Fix hci_inquiry ioctl usage")
Signed-off-by: Pan Bian <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
SinkFinder authored and holtmann committed Jan 25, 2021
1 parent 5a3ef03 commit 28a758c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,8 +1362,10 @@ int hci_inquiry(void __user *arg)
* cleared). If it is interrupted by a signal, return -EINTR.
*/
if (wait_on_bit(&hdev->flags, HCI_INQUIRY,
TASK_INTERRUPTIBLE))
return -EINTR;
TASK_INTERRUPTIBLE)) {
err = -EINTR;
goto done;
}
}

/* for unlimited number of responses we will use buffer with
Expand Down

0 comments on commit 28a758c

Please sign in to comment.