From: Mohamed Abbas Date: Wed, 22 Sep 2010 10:25:09 +0000 (+0200) Subject: Fix ConnMan crash while disable wifi device X-Git-Tag: 0.62~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ceee07de9cc82211c54168d3c0df7a69b1ab2398;p=platform%2Fupstream%2Fconnman.git Fix ConnMan crash while disable wifi device When calling unregister_network() ConnMan sets the network->device pointer to NULL. That is fine with ESSIDs formed by 1 AP. Otherwise, the eventual call to __connman_device_decrease_connections() leads to a crash as the device pointer is NULL. Fixes BMC #6772 --- diff --git a/src/device.c b/src/device.c index 6a9bce6..ad976b5 100644 --- a/src/device.c +++ b/src/device.c @@ -1371,11 +1371,17 @@ int __connman_device_set_offlinemode(connman_bool_t offlinemode) void __connman_device_increase_connections(struct connman_device *device) { + if (device == NULL) + return; + device->connections++; } void __connman_device_decrease_connections(struct connman_device *device) { + if (device == NULL) + return; + device->connections--; }