wifi: Fixed issue with device reference count 95/151795/1 accepted/tizen/unified/20170927.063111 submit/tizen/20170922.065607 submit/tizen/20170926.020531
authorSaurav Babu <saurav.babu@samsung.com>
Fri, 22 Sep 2017 04:28:46 +0000 (09:58 +0530)
committerSaurav Babu <saurav.babu@samsung.com>
Fri, 22 Sep 2017 04:34:41 +0000 (10:04 +0530)
Device reference count is referenced when scanning is set to true, so it
should be dereferenced only when scanning is set to false, In one
particular case scanning was not being set to false while device was
unreferenced when wifi->allow_full_scan is true.

Change-Id: Ib8fc675d224eddc8e1dfa4a4a271f7c5b64209fe
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
plugins/wifi.c

index ce53233..5a85785 100755 (executable)
@@ -1323,7 +1323,11 @@ static void scan_callback(int result, GSupplicantInterface *interface,
         * unreferenced the device, obviating the need to do it here.
         */
 
+#if defined TIZEN_EXT
+       if (scanning && wifi && !wifi->allow_full_scan)
+#else
        if (scanning)
+#endif
                connman_device_unref(device);
 
 #if defined TIZEN_EXT