From: Daniel Wagner Date: Thu, 28 Jul 2011 10:08:40 +0000 (+0200) Subject: network: Set driver pointer to NULL back if not ready X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~1284 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a46753eb085547412f542abe804c0275cf46f27f;p=profile%2Fivi%2Fconnman.git 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 --- diff --git a/src/network.c b/src/network.c index 40ab8aa..1dc12fe 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;