Browse Source

Fix segfault on error path if driver initialization fails

wpa_s->wpa is NULL in this case and we better not call WPA state
machine functions.
Jouni Malinen 13 years ago
parent
commit
8c0d3b4fc6
1 changed files with 2 additions and 1 deletions
  1. 2 1
      wpa_supplicant/notify.c

+ 2 - 1
wpa_supplicant/notify.c

@@ -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);
 }