When a wlan interface is removed we call proper method in
supplicant dbus interface. As the return message from supplicant
might come very late, we must not use the wifi pointer as
user data in interface remove callback. This is because the wifi
pointer might be removed before the answer comes from supplicant and
the callback user data pointer would not be valid at that point.
GSupplicantInterface *interface,
void *user_data)
{
- struct wifi_data *wifi = user_data;
+ struct wifi_data *wifi;
+
+ wifi = g_supplicant_interface_get_data(interface);
DBG("result %d wifi %p", result, wifi);
ret = g_supplicant_interface_remove(wifi->interface,
interface_remove_callback,
- wifi);
+ NULL);
if (ret < 0)
return ret;