Commit 49e69381 authored by Pan Bian's avatar Pan Bian Committed by Greg Kroah-Hartman
Browse files

Bluetooth: Put HCI device if inquiry procedure interrupts



[ Upstream commit 28a758c8 ]

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

Fixes: 3e13fa1e ("Bluetooth: Fix hci_inquiry ioctl usage")
Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 39bce4ab
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1278,8 +1278,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