DBG("network %p", network);
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
dbus_error_init(&error);
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static int pan_connect(struct connman_network *network)
DBG("network %p", network);
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
dbus_error_init(&error);
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static int pan_disconnect(struct connman_network *network)
reply = dbus_pending_call_steal_reply(call);
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static int change_powered(DBusConnection *connection, const char *path,
char ident[13];
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
extract_properties(reply, &parent, &address, NULL, &name,
NULL, NULL, &uuids, NULL);
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static void add_network(struct connman_device *device, const char *path)
DBG("path %s", path);
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
if (path == NULL)
goto done;
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static void add_adapter(DBusConnection *connection, const char *path)
DBG("");
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
dbus_error_init(&error);
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static void unregister_device(gpointer data)
}
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static int gprs_change_powered(const char *path, dbus_bool_t powered)
DBG("network %p", network);
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- goto done;
if (dbus_message_iter_init(reply, &array) == FALSE)
goto done;
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static void config_network(struct connman_network *network, const char *path)
DBG("network %p", network);
- if (pending_network_is_available(network) == FALSE)
- return;
-
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
+
+ if (pending_network_is_available(network) == FALSE)
+ goto done;
dbus_error_init(&error);
if (dbus_set_error_from_message(&error, reply)) {
} else
pending_network = network;
+done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static int set_network_active(struct connman_network *network,
DBG("device %p", device);
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- goto done;
if (dbus_message_iter_init(reply, &array) == FALSE)
goto done;
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static void check_networks(struct modem_data *modem)
DBG("path %s", path);
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
if (dbus_message_iter_init(reply, &array) == FALSE)
goto done;
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static void get_imsi(const char *path)
DBG("path %s", path);
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- goto done;
if (dbus_message_iter_init(reply, &array) == FALSE)
goto done;
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static void get_modem_properties(struct modem_data *modem)
DBG("");
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- goto done;
if (dbus_message_iter_init(reply, &array) == FALSE)
goto done;
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static void modem_remove_device(struct modem_data *modem)
DBG("task %p", task);
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
goto failed;
dbus_message_unref(reply);
+ dbus_pending_call_unref(call);
+
return;
failed:
dbus_message_unref(reply);
+ dbus_pending_call_unref(call);
+
task_list = g_slist_remove(task_list, task);
connman_device_unref(task->device);
DBG("task %p", task);
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) {
add_interface(task);
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static int create_interface(struct supplicant_task *task)
free_task(task);
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
static int remove_interface(struct supplicant_task *task)
task->scan_call = NULL;
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) {
connman_device_set_scanning(task->device, FALSE);
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
DBG("task %p", task);
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL) {
- get_properties(task);
- return;
- }
- if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) {
- dbus_message_unref(reply);
- get_properties(task);
- return;
- }
+ if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
+ goto unref;
memset(&result, 0, sizeof(result));
result.frequency = -1;
g_free(result.name);
g_free(result.ssid);
+unref:
dbus_message_unref(reply);
+ dbus_pending_call_unref(call);
+
get_properties(task);
}
DBG("task %p", task);
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- goto noscan;
if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
goto done;
dbus_message_unref(reply);
+ dbus_pending_call_unref(call);
+
get_properties(task);
return;
done:
dbus_message_unref(reply);
-noscan:
+ dbus_pending_call_unref(call);
+
task->result_call = NULL;
if (task->scanning == TRUE) {