summaryrefslogtreecommitdiff
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJefferson Delfes <jefferson.delfes@openbossa.org>2012-09-18 17:36:54 (GMT)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-09-27 21:08:01 (GMT)
commit36a75f1b3ecf94dcf140b9d3d2f7a03b7e258480 (patch)
tree3c99de6e81b10597c6e8203e76a0c5f695985111 /net/bluetooth/mgmt.c
parent392f44d3e7894f6fe314b85b4a1611b7b1d98226 (diff)
downloadlinux-fsl-qoriq-36a75f1b3ecf94dcf140b9d3d2f7a03b7e258480.tar.xz
Bluetooth: Force the process of unpair command if disconnect failed
The unpair process tries to disconnect any connection pending with remote. If there are some connection in connecting state, disconnect command will fail and unpair mgmt command will stay pending. That pending mgmt command can cause strange behavior like automatic unpair after a lost connection. Signed-off-by: Jefferson Delfes <jefferson.delfes@openbossa.org> Acked-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 8934343..b127b88 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3109,6 +3109,9 @@ int mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr,
struct pending_cmd *cmd;
int err;
+ mgmt_pending_foreach(MGMT_OP_UNPAIR_DEVICE, hdev, unpair_device_rsp,
+ hdev);
+
cmd = mgmt_pending_find(MGMT_OP_DISCONNECT, hdev);
if (!cmd)
return -ENOENT;
@@ -3121,8 +3124,6 @@ int mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr,
mgmt_pending_remove(cmd);
- mgmt_pending_foreach(MGMT_OP_UNPAIR_DEVICE, hdev, unpair_device_rsp,
- hdev);
return err;
}