aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2011-11-07 15:16:03 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-11-08 09:54:10 -0500
commit2d7cee5836d6d466829b255b1290c9386d4e884f (patch)
treee87b27c8fa32226f7368c9f01329696c30d3d39c /net/bluetooth/hci_event.c
parent16ab91ab48287aa4fc757f3618820f728ee4412f (diff)
Bluetooth: Fix mgmt response when HCI_Write_Scan_Enable fails
A proper mgmt_command_status should be returned to user-space if either discoverable or connectable enabling fails. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index cf9926565937..176cecae4b42 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -280,11 +280,14 @@ static void hci_cc_write_scan_enable(struct hci_dev *hdev, struct sk_buff *skb)
280 if (!sent) 280 if (!sent)
281 return; 281 return;
282 282
283 if (status != 0)
284 goto done;
285
286 param = *((__u8 *) sent); 283 param = *((__u8 *) sent);
287 284
285 if (status != 0) {
286 mgmt_write_scan_failed(hdev->id, param, status);
287 hdev->discov_timeout = 0;
288 goto done;
289 }
290
288 old_pscan = test_and_clear_bit(HCI_PSCAN, &hdev->flags); 291 old_pscan = test_and_clear_bit(HCI_PSCAN, &hdev->flags);
289 old_iscan = test_and_clear_bit(HCI_ISCAN, &hdev->flags); 292 old_iscan = test_and_clear_bit(HCI_ISCAN, &hdev->flags);
290 293