summaryrefslogtreecommitdiff
path: root/src/network.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner at bmw-carit.de>2011-07-28 12:08:40 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-07-28 17:43:44 +0200
commita46753eb085547412f542abe804c0275cf46f27f (patch)
tree3e46b0f8dd834c35dccf7d40f5beb0df2afd990b /src/network.c
parent10520d0b86c6eb022785f046801b577c8877ea38 (diff)
downloadconnman-a46753eb085547412f542abe804c0275cf46f27f.tar.gz
connman-a46753eb085547412f542abe804c0275cf46f27f.tar.bz2
connman-a46753eb085547412f542abe804c0275cf46f27f.zip
network: Set driver pointer to NULL back if not ready
The network_probe() function will be called several times until it creates successfuly the service object. In the case of the oFono plugin, the connman_device_add_network() is called after the driver has been registered to the network. Therefore the network->driver has been set but no device yet. __connman_service_create_from_network() returns -EINVAL because the device is not yet set. The next call on network_probe() will bail out on 'if (network->driver != NULL) return -EALREADY;' so we have to reset it in the first round. Fixes BMC #21705
Diffstat (limited to 'src/network.c')
-rw-r--r--src/network.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network.c b/src/network.c
index 40ab8aac..1dc12fe8 100644
--- a/src/network.c
+++ b/src/network.c
@@ -162,8 +162,10 @@ static int network_probe(struct connman_network *network)
case CONNMAN_NETWORK_TYPE_WIFI:
case CONNMAN_NETWORK_TYPE_WIMAX:
network->driver = driver;
- if (__connman_service_create_from_network(network) == NULL)
+ if (__connman_service_create_from_network(network) == NULL) {
+ network->driver = NULL;
return -EINVAL;
+ }
}
return 0;