diff options
author | Pan Bian <bianpan2016@163.com> | 2021-01-21 11:10:45 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2021-01-25 18:14:58 +0300 |
commit | 28a758c861ff290e39d4f1ee0aa5df0f0b9a45ee (patch) | |
tree | b639952b85e47b1753dbb0337d1f3b1d61e57c6c /net/bluetooth | |
parent | 5a3ef03afe7e12982dc3b978f4c5077c907f7501 (diff) | |
download | linux-28a758c861ff290e39d4f1ee0aa5df0f0b9a45ee.tar.xz |
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>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index b0a63f643a07..9ea6f3c80a81 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -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 |