summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2021-01-21 00:10:45 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-03 16:44:15 +0100
commit9c241b9a671f2e9eb6d85870eb7c6ec46f35d8cc (patch)
tree30f8699debb7e20ad6915f6c7dc9a65054cdf921
parent9729dcb127c890b3444d5387eaf3f3ef1058eabc (diff)
Bluetooth: Put HCI device if inquiry procedure interrupts
[ Upstream commit 28a758c861ff290e39d4f1ee0aa5df0f0b9a45ee ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--net/bluetooth/hci_core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 4bce3ef2c392..cc905a4e5732 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1372,8 +1372,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