浏览代码

Bluetooth: Fix error response for simultaneous fast connectable commands

If there's another pending mgmt_set_fast_connectable command we should
return a "busy" error 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>
Johan Hedberg 12 年之前
父节点
当前提交
05cbf29f84
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      net/bluetooth/mgmt.c

+ 6 - 0
net/bluetooth/mgmt.c

@@ -2953,6 +2953,12 @@ static int set_fast_connectable(struct sock *sk, struct hci_dev *hdev,
 
 
 	hci_dev_lock(hdev);
 	hci_dev_lock(hdev);
 
 
+	if (mgmt_pending_find(MGMT_OP_SET_FAST_CONNECTABLE, hdev)) {
+		err = cmd_status(sk, hdev->id, MGMT_OP_SET_FAST_CONNECTABLE,
+				 MGMT_STATUS_BUSY);
+		goto unlock;
+	}
+
 	if (cp->val) {
 	if (cp->val) {
 		type = PAGE_SCAN_TYPE_INTERLACED;
 		type = PAGE_SCAN_TYPE_INTERLACED;