Re: [PATCH 1/1] Fix p2p driver probe

2014-04-04 Thread Tomasz Bursztyka

Hi Eduardo,


+   struct connman_technology *technology;


Useless var, see below.

  
  	for (list = driver_list; list; list = list-next) {

if (list-data == driver)
@@ -1254,8 +1255,11 @@ int connman_technology_driver_register(struct 
connman_technology_driver *driver)
  
  exist:

if (driver-type == CONNMAN_SERVICE_TYPE_P2P) {
-   if (!technology_get(CONNMAN_SERVICE_TYPE_P2P))
+   technology = technology_get(CONNMAN_SERVICE_TYPE_P2P);
+   if (!technology)


Keep the code as before, you are not fixing anything here.


return -ENOMEM;
+   else if (driver-probe)
+   driver-probe(technology);
}


If wifi is disabled, it gets soft-rfkill: at this point p2p technology 
should be unregistered, thus no longer exist in the technology list.


It seems you have found a p2p technology refcount issue.
I instrumented a bit and it's then visible:

connmand[10575]: src/technology.c:connman_technology_driver_unregister() 
Unregistering driver 0x6b92c0 name p2p

connmand[10575]: src/technology.c:technology_find() type 9
connmand[10575]: src/technology.c:technology_put() technology 0x20ef690 
- refs 2


When disabling wifi: p2p really should disappear.

Will fix that.

Thanks for testing and finding an issue,

Tomasz
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH 1/1] Fix p2p driver probe

2014-04-03 Thread Eduardo Abinader
For a p2p driver previously registered, after disabling wifi and
enabling again, p2p driver probe was missing.
---
 src/technology.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/technology.c b/src/technology.c
index 5a12202..fdb429a 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -1220,6 +1220,7 @@ int connman_technology_driver_register(struct 
connman_technology_driver *driver)
GSList *list;
struct connman_device *device;
enum connman_service_type type;
+   struct connman_technology *technology;
 
for (list = driver_list; list; list = list-next) {
if (list-data == driver)
@@ -1254,8 +1255,11 @@ int connman_technology_driver_register(struct 
connman_technology_driver *driver)
 
 exist:
if (driver-type == CONNMAN_SERVICE_TYPE_P2P) {
-   if (!technology_get(CONNMAN_SERVICE_TYPE_P2P))
+   technology = technology_get(CONNMAN_SERVICE_TYPE_P2P);
+   if (!technology)
return -ENOMEM;
+   else if (driver-probe)
+   driver-probe(technology);
}
 
return 0;
-- 
1.8.3.2

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman