network: don't connect if already removed
authorPekka Pessi <Pekka.Pessi@nokia.com>
Mon, 30 Aug 2010 15:21:12 +0000 (18:21 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 8 Sep 2010 18:06:23 +0000 (20:06 +0200)
src/network.c

index 68769e4..01f7a2f 100644 (file)
@@ -1042,6 +1042,9 @@ int __connman_network_connect(struct connman_network *network)
        if (network->driver->connect == NULL)
                return -ENOSYS;
 
+       if (network->device == NULL)
+               return -ENODEV;
+
        __connman_device_disconnect(network->device);
 
        network->connecting = TRUE;