Skip to content

Commit 63cb4aa

Browse files
SinkFindergregkh
authored andcommitted
Bluetooth: Put HCI device if inquiry procedure interrupts
[ 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>
1 parent 78bbee8 commit 63cb4aa

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

net/bluetooth/hci_core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,8 +1356,10 @@ int hci_inquiry(void __user *arg)
13561356
* cleared). If it is interrupted by a signal, return -EINTR.
13571357
*/
13581358
if (wait_on_bit(&hdev->flags, HCI_INQUIRY,
1359-
TASK_INTERRUPTIBLE))
1360-
return -EINTR;
1359+
TASK_INTERRUPTIBLE)) {
1360+
err = -EINTR;
1361+
goto done;
1362+
}
13611363
}
13621364

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

0 commit comments

Comments
 (0)