diff options
author | Pekka Pessi <Pekka.Pessi@nokia.com> | 2010-08-26 17:26:45 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-09-09 20:44:42 +0200 |
commit | 848e3fda47bfe9ab743700f5dd0888b569431ee8 (patch) | |
tree | 018d97e310495e19df18e83fbbfcdcdaa9305019 /plugins | |
parent | 8a225689c0705a181b77a17054ac06d1a77b5613 (diff) | |
download | connman-848e3fda47bfe9ab743700f5dd0888b569431ee8.tar.gz connman-848e3fda47bfe9ab743700f5dd0888b569431ee8.tar.bz2 connman-848e3fda47bfe9ab743700f5dd0888b569431ee8.zip |
ofono: fix pending_network_is_available()
connman_network_get_device() returns NULL if network has been removed.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ofono.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c index 95e56e4a..10691864 100644 --- a/plugins/ofono.c +++ b/plugins/ofono.c @@ -498,32 +498,12 @@ static struct connman_network *pending_network; static gboolean pending_network_is_available(struct connman_network *network) { - struct connman_device *device; - struct connman_network *temp_network; - const char *identifier; - char *ident; - - /* Modem may be removed during waiting for active reply */ - device = connman_network_get_device(network); - if (device == NULL) { - DBG("Modem is removed"); + /* Modem or network may be removed during waiting for active reply */ + if (connman_network_get_device(network) == NULL) { + DBG("Modem or network was removed"); return FALSE; } - identifier = connman_network_get_identifier(network); - - ident = g_strdup(identifier); - - connman_network_unref(network); - - /* network may be removed during waiting for active reply */ - temp_network = connman_device_get_network(device, ident); - - g_free(ident); - - if (temp_network == NULL) - return FALSE; - return TRUE; } |