diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-01-20 07:27:22 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-01-22 23:03:33 -0500 |
commit | 5d0846d416a6c8b7fda1b24aa7369818a7dfa00e (patch) | |
tree | 04a1f123ebcf953086ce3afb323d214fd71eb767 /net/bluetooth | |
parent | 06a63b19e9eb90402e465d60d4c2564afd3ca211 (diff) |
Bluetooth: Fix returning proper cmd_complete for mgmt_block/unblock
The Block/Unblock Device Management commands should return Command
Complete instead of Command Status whenever possible so that user space
can distinguish exactly which command failed in the case of multiple
commands. This patch does the necessary changes in the command handler
to return the right event to user space.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 7b8bc7c658b2..e7f944f52ff2 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -2598,8 +2598,9 @@ static int block_device(struct sock *sk, struct hci_dev *hdev, void *data, | |||
2598 | BT_DBG("%s", hdev->name); | 2598 | BT_DBG("%s", hdev->name); |
2599 | 2599 | ||
2600 | if (!bdaddr_type_is_valid(cp->addr.type)) | 2600 | if (!bdaddr_type_is_valid(cp->addr.type)) |
2601 | return cmd_status(sk, hdev->id, MGMT_OP_BLOCK_DEVICE, | 2601 | return cmd_complete(sk, hdev->id, MGMT_OP_BLOCK_DEVICE, |
2602 | MGMT_STATUS_INVALID_PARAMS); | 2602 | MGMT_STATUS_INVALID_PARAMS, |
2603 | &cp->addr, sizeof(cp->addr)); | ||
2603 | 2604 | ||
2604 | hci_dev_lock(hdev); | 2605 | hci_dev_lock(hdev); |
2605 | 2606 | ||
@@ -2627,8 +2628,9 @@ static int unblock_device(struct sock *sk, struct hci_dev *hdev, void *data, | |||
2627 | BT_DBG("%s", hdev->name); | 2628 | BT_DBG("%s", hdev->name); |
2628 | 2629 | ||
2629 | if (!bdaddr_type_is_valid(cp->addr.type)) | 2630 | if (!bdaddr_type_is_valid(cp->addr.type)) |
2630 | return cmd_status(sk, hdev->id, MGMT_OP_UNBLOCK_DEVICE, | 2631 | return cmd_complete(sk, hdev->id, MGMT_OP_UNBLOCK_DEVICE, |
2631 | MGMT_STATUS_INVALID_PARAMS); | 2632 | MGMT_STATUS_INVALID_PARAMS, |
2633 | &cp->addr, sizeof(cp->addr)); | ||
2632 | 2634 | ||
2633 | hci_dev_lock(hdev); | 2635 | hci_dev_lock(hdev); |
2634 | 2636 | ||