[PATCH] Bluetooth: Force the process of unpair command if disconnect failed

Subsystems: bluetooth subsystem, the rest

STALE5102d

3 messages, 3 authors, 2012-09-27 · open the first message on its own page

[PATCH] Bluetooth: Force the process of unpair command if disconnect failed

From: Jefferson Delfes <hidden>
Date: 2012-09-18 17:36:54

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.
---
 net/bluetooth/mgmt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 05d4b83..78caef2 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3108,6 +3108,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;
@@ -3120,8 +3123,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;
 }
 
-- 
1.7.12

Re: [PATCH] Bluetooth: Force the process of unpair command if disconnect failed

From: Johan Hedberg <hidden>
Date: 2012-09-20 11:16:49

Hi Jefferson,

On Tue, Sep 18, 2012, Jefferson Delfes wrote:
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.
---
 net/bluetooth/mgmt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Acked-by: Johan Hedberg <redacted>

Johan

Re: [PATCH] Bluetooth: Force the process of unpair command if disconnect failed

From: Gustavo Padovan <hidden>
Date: 2012-09-27 21:09:05

Hi Jefferson,

* Jefferson Delfes [off-list ref] [2012-09-18 13:36:54 -0400]:
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.
---
 net/bluetooth/mgmt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Patch has been applied to bluetooth-next. Thanks.

	Gustavo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help