gsupplicant's interface scanning value is slow to be updated since it's wpa_s event
which updates it, thus leading to a time gap where it is possible to request another scan.
It will therefore reference once again device, which will lead to too many references hold
by wifi plugin
if (wifi->tethering == TRUE)
return 0;
+ if (connman_device_get_scanning(device) == TRUE)
+ return -EALREADY;
+
connman_device_ref(device);
ret = g_supplicant_interface_scan(wifi->interface, NULL,
if (wifi->tethering == TRUE)
return 0;
+ if (connman_device_get_scanning(device) == TRUE)
+ return -EALREADY;
+
driver_max_ssids = g_supplicant_interface_get_max_scan_ssids(
wifi->interface);
DBG("max ssids %d", driver_max_ssids);
if (ssid == NULL || ssid_len == 0 || ssid_len > 32)
return -EINVAL;
+ if (connman_device_get_scanning(device) == TRUE)
+ return -EALREADY;
+
scan_params = g_try_malloc0(sizeof(GSupplicantScanParams));
if (scan_params == NULL)
return -ENOMEM;