From: Jouni Malinen Date: Mon, 14 Apr 2014 21:20:17 +0000 (+0300) Subject: P2P: Fix interface remove to terminate all P2P groups X-Git-Tag: hostap_2_2~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e83e15ee771988c57b73cb4badf728aaf0943291;p=thirdparty%2Fhostap.git P2P: Fix interface remove to terminate all P2P groups Previously, it was possible to remove the main interface and leave behind dynamic P2P group interfaces. This would eventually result in references freed memory, so it is not really suitable behavior. Instesd, remove all the dynamic P2P group interfaces that were created through an interface that is now removed. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index a9fbf007b..7285bec4b 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -3679,6 +3679,8 @@ static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s, wpa_supplicant_cleanup(wpa_s); #ifdef CONFIG_P2P + if (wpa_s == wpa_s->parent) + wpas_p2p_group_remove(wpa_s, "*"); if (wpa_s == wpa_s->global->p2p_init_wpa_s && wpa_s->global->p2p) { wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Disable P2P since removing " "the management interface is being removed");