summaryrefslogtreecommitdiff
path: root/plugins/supplicant.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-03-22 13:10:13 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2010-03-22 17:56:34 +0100
commit678e15dba2930464631ddca47b42a9d8473b1175 (patch)
treeab0ab255f5f92c7c10625707b00c4edf2d4e0598 /plugins/supplicant.c
parent4997f6e38f34effc00179e849dee0dc2e2263d3a (diff)
downloadconnman-678e15dba2930464631ddca47b42a9d8473b1175.tar.gz
connman-678e15dba2930464631ddca47b42a9d8473b1175.tar.bz2
connman-678e15dba2930464631ddca47b42a9d8473b1175.zip
Check for task->path when removing an interface or a network
We need to be more careful about task->path since it could disappear on us if we want to go offline before we get the add_interface D-Bus reply.
Diffstat (limited to 'plugins/supplicant.c')
-rw-r--r--plugins/supplicant.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/supplicant.c b/plugins/supplicant.c
index ea71dba1..bdb21cd4 100644
--- a/plugins/supplicant.c
+++ b/plugins/supplicant.c
@@ -509,6 +509,9 @@ static int remove_interface(struct supplicant_task *task)
DBG("task %p", task);
+ if (task->path == NULL)
+ return 0;
+
#if 0
if (task->created == FALSE) {
connman_device_set_powered(task->device, FALSE);
@@ -648,7 +651,7 @@ static int remove_network(struct supplicant_task *task)
DBG("task %p", task);
- if (task->netpath == NULL)
+ if (task->netpath == NULL || task->path == NULL)
return -EINVAL;
message = dbus_message_new_method_call(SUPPLICANT_NAME, task->path,
@@ -733,6 +736,9 @@ static int disconnect_network(struct supplicant_task *task)
DBG("task %p", task);
+ if (task->path == NULL)
+ return -EINVAL;
+
message = dbus_message_new_method_call(SUPPLICANT_NAME, task->path,
SUPPLICANT_INTF ".Interface", "disconnect");
if (message == NULL)