diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-01-20 07:27:20 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-01-22 23:00:05 -0500 |
commit | 118da70b760f04bb2b8130ced97a9f9cc173440a (patch) | |
tree | ee56972651c584b0033284bd1d95bcdf69e1f27e | |
parent | 4ee71b2017336f68128515bdbe7c946a39aa9250 (diff) |
Bluetooth: Fix checking for valid disconnect parameters in unpair_device
The valid values for the Disconnect parameter in the Unpair Device
command are 0x00 and 0x01. If any other value is encountered the command
should fail with the appropriate invalid params response.
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>
-rw-r--r-- | net/bluetooth/mgmt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 7dd2de1c2152..e5e865d8afa8 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1590,6 +1590,11 @@ static int unpair_device(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1590 | MGMT_STATUS_INVALID_PARAMS, | 1590 | MGMT_STATUS_INVALID_PARAMS, |
1591 | &rp, sizeof(rp)); | 1591 | &rp, sizeof(rp)); |
1592 | 1592 | ||
1593 | if (cp->disconnect != 0x00 && cp->disconnect != 0x01) | ||
1594 | return cmd_complete(sk, hdev->id, MGMT_OP_UNPAIR_DEVICE, | ||
1595 | MGMT_STATUS_INVALID_PARAMS, | ||
1596 | &rp, sizeof(rp)); | ||
1597 | |||
1593 | hci_dev_lock(hdev); | 1598 | hci_dev_lock(hdev); |
1594 | 1599 | ||
1595 | if (!hdev_is_powered(hdev)) { | 1600 | if (!hdev_is_powered(hdev)) { |