Re: [PATCH] wifi: Add sanity check in the middle of chicken and egg issue

2014-08-11 Thread Tomasz Bursztyka

Hi Eduardo,


Got a segmentation fault in the middle of a group
configuration, where the pending p2p-wlan was no
more available. This check actually comes ahead of
another one in interface_added.


Indeed. I am pretty sure we will get some cases like that, in different 
context

and time frames.

ACK

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


Re: [PATCH] wifi: Add sanity check in the middle of chicken and egg issue

2014-08-11 Thread Patrik Flykt
On Sun, 2014-08-10 at 22:45 -0400, Eduardo Abinader wrote:
 Got a segmentation fault in the middle of a group
 configuration, where the pending p2p-wlan was no
 more available. This check actually comes ahead of
 another one in interface_added.

Applied, thanks!

Patrik

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


[PATCH] wifi: Add sanity check in the middle of chicken and egg issue

2014-08-10 Thread Eduardo Abinader
Got a segmentation fault in the middle of a group
configuration, where the pending p2p-wlan was no
more available. This check actually comes ahead of
another one in interface_added.
---
 plugins/wifi.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 861304b..f741bec 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -178,9 +178,14 @@ static struct wifi_data *get_pending_wifi_data(const char 
*ifname)
GList *list;
 
for (list = pending_wifi_device; list; list = list-next) {
-   struct wifi_data *wifi = list-data;
-   const char *dev_name = connman_device_get_string(wifi-device,
-   Interface);
+   struct wifi_data *wifi;
+   const char *dev_name;
+
+   wifi = list-data;
+   if (!wifi)
+   continue;
+
+   dev_name = connman_device_get_string(wifi-device, Interface);
if (!g_strcmp0(ifname, dev_name)) {
pending_wifi_device = g_list_delete_link(
pending_wifi_device, list);
-- 
1.9.1

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