Commit 489dc48e authored by Andrzej Kaczmarek's avatar Andrzej Kaczmarek Committed by Johan Hedberg

Bluetooth: Return proper mgmt state when LE pairing connection failed

MGMT_STATUS_BUSY should be returned when LE pairing cannot be started due
to another outgoing connection attempt is ongoing.
Signed-off-by: default avatarAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent dfc94dbd
...@@ -1911,8 +1911,15 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, ...@@ -1911,8 +1911,15 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
rp.addr.type = cp->addr.type; rp.addr.type = cp->addr.type;
if (IS_ERR(conn)) { if (IS_ERR(conn)) {
int status;
if (PTR_ERR(conn) == -EBUSY)
status = MGMT_STATUS_BUSY;
else
status = MGMT_STATUS_CONNECT_FAILED;
err = cmd_complete(sk, hdev->id, MGMT_OP_PAIR_DEVICE, err = cmd_complete(sk, hdev->id, MGMT_OP_PAIR_DEVICE,
MGMT_STATUS_CONNECT_FAILED, &rp, status, &rp,
sizeof(rp)); sizeof(rp));
goto unlock; goto unlock;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment