[PATCH] wpa_supplicant: Set null radio when no more used

Eduardo Abinader eduardo.abinader
Fri Feb 6 05:44:27 PST 2015


This patch avoids a segmentation fault that is occurring
when a removed pending p2p interface receives a delayed
scan result and crashes when handled in
wpa_supplicant_event_scan_results.

The scenario being used is a request to pbc join an
autonomous p2p group.

Signed-off-by: Eduardo Abinader <eduardo.abinader at openbossa.org>
---
 wpa_supplicant/wpa_supplicant.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 6ad09a8..0897294 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -3675,13 +3675,13 @@ static void radio_remove_interface(struct wpa_supplicant *wpa_s)
 		   wpa_s->ifname, radio->name);
 	dl_list_del(&wpa_s->radio_list);
 	radio_remove_works(wpa_s, NULL, 0);
-	wpa_s->radio = NULL;
 	if (!dl_list_empty(&radio->ifaces))
 		return; /* Interfaces remain for this radio */
 
 	wpa_printf(MSG_DEBUG, "Remove radio %s", radio->name);
 	eloop_cancel_timeout(radio_start_next_work, radio, NULL);
 	os_free(radio);
+	wpa_s->radio = NULL;
 }
 
 
-- 
1.9.1




More information about the Hostap mailing list