Fix segfault on error path if driver initialization fails
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 20 Oct 2011 18:10:22 +0000 (21:10 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 20 Oct 2011 18:10:22 +0000 (21:10 +0300)
wpa_s->wpa is NULL in this case and we better not call WPA state
machine functions.

wpa_supplicant/notify.c

index ed466bd..75b9acf 100644 (file)
@@ -239,7 +239,8 @@ void wpas_notify_persistent_group_removed(struct wpa_supplicant *wpa_s,
 void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
                                 struct wpa_ssid *ssid)
 {
-       wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid);
+       if (wpa_s->wpa)
+               wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid);
        if (wpa_s->global->p2p_group_formation != wpa_s)
                wpas_dbus_unregister_network(wpa_s, ssid->id);
 }