aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-02-19 10:38:07 -0500
committerMarcel Holtmann <marcel@holtmann.org>2015-02-19 11:05:09 -0500
commita2cb01de1cb1db05b946e0132aeecbb514c57024 (patch)
tree36331b7ac61ec2a46ff80038ed69cf8339bef999
parent94d52dad9ef31e178ccc141dfd8feb84cccde581 (diff)
Bluetooth: Fix checking for pending Set SSP in Set HS handler
Changing the HS setting requires that SSP is enabled, however so far the code only checked for the SSP flag but not a potentially ongoing Set SSP operation. This patch adds a check for a pending Set SSP command in the Set HS handler, and returns a 'busy' error if one is found. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/mgmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index cc67d19a7cb8..3a1b537c9aa6 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2175,6 +2175,12 @@ static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
2175 2175
2176 hci_dev_lock(hdev); 2176 hci_dev_lock(hdev);
2177 2177
2178 if (mgmt_pending_find(MGMT_OP_SET_SSP, hdev)) {
2179 err = cmd_status(sk, hdev->id, MGMT_OP_SET_HS,
2180 MGMT_STATUS_BUSY);
2181 goto unlock;
2182 }
2183
2178 if (cp->val) { 2184 if (cp->val) {
2179 changed = !test_and_set_bit(HCI_HS_ENABLED, &hdev->dev_flags); 2185 changed = !test_and_set_bit(HCI_HS_ENABLED, &hdev->dev_flags);
2180 } else { 2186 } else {