projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
889d07e
)
Bluetooth: Fix response for mgmt_start_discovery when powered off
author
Johan Hedberg
<johan.hedberg@intel.com>
Mon, 7 Nov 2011 21:13:37 +0000
(23:13 +0200)
committer
Gustavo F. Padovan
<padovan@profusion.mobi>
Tue, 8 Nov 2011 15:02:08 +0000
(13:02 -0200)
We should return a ENETDOWN status response if the adapter is powered
off (i.e. the HCI_UP flag isn't set).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/mgmt.c
patch
|
blob
|
blame
|
history
diff --git
a/net/bluetooth/mgmt.c
b/net/bluetooth/mgmt.c
index e33b12e09270d04488bc6fbbdcfbffbde22867d5..af077abdfa98ae549a3a0c27184c305e547d2ab4 100644
(file)
--- a/
net/bluetooth/mgmt.c
+++ b/
net/bluetooth/mgmt.c
@@
-1619,6
+1619,11
@@
static int start_discovery(struct sock *sk, u16 index)
hci_dev_lock_bh(hdev);
+ if (!test_bit(HCI_UP, &hdev->flags)) {
+ err = cmd_status(sk, index, MGMT_OP_START_DISCOVERY, ENETDOWN);
+ goto failed;
+ }
+
cmd = mgmt_pending_add(sk, MGMT_OP_START_DISCOVERY, index, NULL, 0);
if (!cmd) {
err = -ENOMEM;