From ceee07de9cc82211c54168d3c0df7a69b1ab2398 Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Wed, 22 Sep 2010 12:25:09 +0200 Subject: [PATCH] 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 --- src/device.c | 6 ++++++ 1 file changed, 6 insertions(+) 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--; } -- 2.7.4