Skip to contentSkip to conversation

core/device: Fix not responding to Connect

PATCH Applied Luiz Augusto von Dentz 1 participant 2 messages Nov 9, 2015 – Nov 13, 2015 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH v2 1/1 core/device: Fix not responding to Connect

From: Luiz Augusto von Dentz <[email protected]>

If profile is removed while its connection is pending it may not respond to Connect method and not cleaning up properly leaving dev->connect set which will prevent any attempt to connect to the device again.
---
v2: Keep code removing service for the list since it is no garanteed that device_profile_connected will be called as it depend on the profile state.

 src/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/device.c +1 -1
index 6722976..e76b8bb 100644
@@ -1498,7 +1498,7 @@ static void device_profile_connected(struct btd_device *dev,
 		btd_device_set_temporary(dev, false);
 
 	if (dev->pending == NULL)
-		return;
+		goto done;
 
 	if (!btd_device_is_connected(dev)) {
 		switch (-err) {
Signature · 1 line
2.4.3
author maintainer Applied
#1 lore raw

Hi,

Quoted 26 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

If profile is removed while its connection is pending it may not respond to Connect method and not cleaning up properly leaving dev->connect set which will prevent any attempt to connect to the device again.
---
v2: Keep code removing service for the list since it is no garanteed that device_profile_connected will be called as it depend on the profile state.

 src/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/device.c +1 -2
index 6722976..e76b8bb 100644
@@ -1498,7 +1498,7 @@ static void device_profile_connected(struct btd_device *dev,
                btd_device_set_temporary(dev, false);
 
        if (dev->pending == NULL)
-               return;
+               goto done;
 
        if (!btd_device_is_connected(dev)) {
                switch (-err) {
--
Quoted 1 line

2.4.3

Applied.

Signature · 1 line
Luiz Augusto von Dentz