From d1b024c9e5c6fa38ac0a9fb854763837336aad46 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 18 Nov 2010 12:41:27 +0200 Subject: [PATCH] P2P: Make sure wpa_s->global->p2p_group_formation gets cleared This pointer is now used in number of places to check whether an interface is in P2P Group Formation, so we better make sure it gets cleared when group formation has been completed. This was done in only some of the cases. --- wpa_supplicant/p2p_supplicant.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index f12156799..fe96ff457 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -422,6 +422,7 @@ static void wpas_group_formation_completed(struct wpa_supplicant *wpa_s, */ if (wpa_s->global->p2p_group_formation) wpa_s = wpa_s->global->p2p_group_formation; + wpa_s->global->p2p_group_formation = NULL; wpa_s->p2p_in_provisioning = 0; if (!success) { @@ -782,6 +783,8 @@ static void p2p_go_configured(void *ctx, void *data) ssid = wpa_s->current_ssid; if (ssid && ssid->mode == WPAS_MODE_P2P_GO) { wpa_printf(MSG_DEBUG, "P2P: Group setup without provisioning"); + if (wpa_s->global->p2p_group_formation == wpa_s) + wpa_s->global->p2p_group_formation = NULL; wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED "%s GO ssid=\"%s\" freq=%d passphrase=\"%s\" " "go_dev_addr=" MACSTR "%s",