From: Johan Hedberg Date: Fri, 15 Mar 2013 22:07:07 +0000 (-0500) Subject: Bluetooth: Fix error response for simultaneous fast connectable commands X-Git-Tag: v4.13~9653^2~170^2^2~116^2~10 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=05cbf29f84f2cf17554b58a3ab4a0ac46d52eca6;p=mirror_ubuntu-bionic-kernel.git 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 Acked-by: Marcel Holtmann Signed-off-by: Gustavo Padovan --- diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 34caf30584c2..e89938e0233c 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -2953,6 +2953,12 @@ static int set_fast_connectable(struct sock *sk, struct hci_dev *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) { type = PAGE_SCAN_TYPE_INTERLACED;