summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2011-09-06 10:13:16 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-09-12 12:14:14 +0200
commit988a7a8d7c4bdc40e770f0a20f2da33e49386207 (patch)
tree3f3e84c0997eeca70e938a1b5bd637c12a7fc975 /plugins
parent3c884c4ef7dfaa2e2e017ef9b50bf43d28f7f603 (diff)
downloadconnman-988a7a8d7c4bdc40e770f0a20f2da33e49386207.tar.gz
connman-988a7a8d7c4bdc40e770f0a20f2da33e49386207.tar.bz2
connman-988a7a8d7c4bdc40e770f0a20f2da33e49386207.zip
wifi: Add NULL checks in interface create and remove
Interface create and remove callbacks can be called with wifi user data set to NULL, add checks for this.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/wifi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 7ed28148..ee305861 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -200,10 +200,11 @@ static void interface_create_callback(int result,
{
struct wifi_data *wifi = user_data;
- DBG("result %d ifname %s", result,
- g_supplicant_interface_get_ifname(interface));
+ DBG("result %d ifname %s, wifi %p", result,
+ g_supplicant_interface_get_ifname(interface),
+ wifi);
- if (result < 0)
+ if (result < 0 || wifi == NULL)
return;
wifi->interface = interface;
@@ -216,9 +217,9 @@ static void interface_remove_callback(int result,
{
struct wifi_data *wifi = user_data;
- DBG("result %d", result);
+ DBG("result %d wifi %p", result, wifi);
- if (result < 0)
+ if (result < 0 || wifi == NULL)
return;
wifi->interface = NULL;