ofono: Set network group when adding the network
authorMohamed Abbas <mabbas@linux.intel.com>
Mon, 22 Nov 2010 20:37:53 +0000 (12:37 -0800)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 23 Nov 2010 00:15:50 +0000 (01:15 +0100)
The network probing code path already calls profile_add_network, calling
it again from the oFono network probing hook leads to wrong reference
counting.

Fixes BMC#9985

plugins/ofono.c

index 691037d..47afe13 100644 (file)
@@ -363,7 +363,6 @@ static void create_service(struct connman_network *network)
 
 static int network_probe(struct connman_network *network)
 {
-       create_service(network);
        return 0;
 }
 
@@ -540,6 +539,9 @@ static int add_network(struct connman_device *device,
        hash_path = connman_network_get_string(network, "Path");
        if (hash_path == NULL)
                goto error;
+
+       create_service(network);
+
        connman_network_ref(network);
        g_hash_table_insert(network_hash, (char *)hash_path, network);