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

Eduardo Abinader eduardo.abinader at openbossa.org
Fri Feb 6 08:44:27 EST 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

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);
 	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);
+	wpa_s->radio = NULL;

More information about the HostAP mailing list