From: Marcel Holtmann Date: Tue, 30 Dec 2008 21:58:41 +0000 (+0100) Subject: Set device before registering network X-Git-Tag: 0.6~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cf39e356ec835dd019ed537fa5012efe61cf822;p=platform%2Fupstream%2Fconnman.git Set device before registering network --- diff --git a/src/device.c b/src/device.c index 5b7ac4f..84be26e 100644 --- a/src/device.c +++ b/src/device.c @@ -836,12 +836,14 @@ int connman_device_add_network(struct connman_device *device, if (device->mode == CONNMAN_DEVICE_MODE_NO_NETWORK) return -EINVAL; + __connman_network_set_device(network, device); + err = connman_element_register((struct connman_element *) network, &device->element); - if (err < 0) + if (err < 0) { + __connman_network_set_device(network, NULL); return err; - - __connman_network_set_device(network, device); + } g_hash_table_insert(device->networks, g_strdup(identifier), network);