diff options
author | Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> | 2012-05-30 09:39:22 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-06-04 23:34:15 -0400 |
commit | 489dc48e7583d825304b0aff3fc17e706627b3c8 (patch) | |
tree | 57d2dfc28807a5a42fbceafbb8e365bd1c54342f /net/bluetooth | |
parent | dfc94dbdb999154dc2ff44e6011a4912c0b29e88 (diff) |
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: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 205574edff20..958f764cc6ab 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1911,8 +1911,15 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1911 | rp.addr.type = cp->addr.type; | 1911 | rp.addr.type = cp->addr.type; |
1912 | 1912 | ||
1913 | if (IS_ERR(conn)) { | 1913 | if (IS_ERR(conn)) { |
1914 | int status; | ||
1915 | |||
1916 | if (PTR_ERR(conn) == -EBUSY) | ||
1917 | status = MGMT_STATUS_BUSY; | ||
1918 | else | ||
1919 | status = MGMT_STATUS_CONNECT_FAILED; | ||
1920 | |||
1914 | err = cmd_complete(sk, hdev->id, MGMT_OP_PAIR_DEVICE, | 1921 | err = cmd_complete(sk, hdev->id, MGMT_OP_PAIR_DEVICE, |
1915 | MGMT_STATUS_CONNECT_FAILED, &rp, | 1922 | status, &rp, |
1916 | sizeof(rp)); | 1923 | sizeof(rp)); |
1917 | goto unlock; | 1924 | goto unlock; |
1918 | } | 1925 | } |