Skip to content

Commit

Permalink
Bluetooth: Put HCI device if inquiry procedure interrupts
Browse files Browse the repository at this point in the history
[ Upstream commit 28a758c ]

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 <bianpan2016@163.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
SinkFinder authored and gregkh committed Mar 4, 2021
1 parent 259ce5a commit 4325398
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/bluetooth/hci_core.c
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 4325398

Please sign in to comment.