Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: Put HCI device if inquiry procedure interrupts

Jump to the label done to decrement the reference count of HCI device
hdev on path that the Inquiry procedure is interrupted.

Fixes: 3e13fa1e1fab ("Bluetooth: Fix hci_inquiry ioctl usage")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Pan Bian and committed by
Marcel Holtmann
28a758c8 5a3ef03a

+4 -2
+4 -2
net/bluetooth/hci_core.c
··· 1362 1362 * cleared). If it is interrupted by a signal, return -EINTR. 1363 1363 */ 1364 1364 if (wait_on_bit(&hdev->flags, HCI_INQUIRY, 1365 - TASK_INTERRUPTIBLE)) 1366 - return -EINTR; 1365 + TASK_INTERRUPTIBLE)) { 1366 + err = -EINTR; 1367 + goto done; 1368 + } 1367 1369 } 1368 1370 1369 1371 /* for unlimited number of responses we will use buffer with