summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-10-14 16:20:05 +0300
committerMarcel Holtmann <marcel@holtmann.org>2013-10-14 06:48:08 -0700
commit37438c1f7f6d26e1532d6bfc588c958b7dfae668 (patch)
tree789d6e3fa4539c85bdc4ac35129b2434d8467aeb /net/bluetooth/mgmt.c
parentd7b856f9380d95a9d663180701da904123c035b8 (diff)
Bluetooth: Add missing error handling for Set Connectable
If the HCI commands related to the Set Connectable command fail we will get a non-zero status in the request completion callback. In such a case we must respond with the appropriate command status message to user space. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 8dcea7726f8..a5c015cadd5 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1086,6 +1086,12 @@ static void set_connectable_complete(struct hci_dev *hdev, u8 status)
if (!cmd)
goto unlock;
+ if (status) {
+ u8 mgmt_err = mgmt_status(status);
+ cmd_status(cmd->sk, cmd->index, cmd->opcode, mgmt_err);
+ goto remove_cmd;
+ }
+
cp = cmd->param;
if (cp->val)
changed = !test_and_set_bit(HCI_CONNECTABLE, &hdev->dev_flags);
@@ -1097,6 +1103,7 @@ static void set_connectable_complete(struct hci_dev *hdev, u8 status)
if (changed)
new_settings(hdev, cmd->sk);
+remove_cmd:
mgmt_pending_remove(cmd);
unlock: