diff mbox

wpa_supplicant: clear get_pref_freq_list_override on p2p device

Message ID 1499279107-12997-1-git-send-email-andrei.otcheretianski@intel.com
State Accepted
Headers show

Commit Message

Andrei Otcheretianski July 5, 2017, 6:25 p.m. UTC
From: Andrei <andrei.otcheretianski@intel.com>

Move the clearing of the get_pref_freq_list_override to
p2p_ctrl_flush(). This fixes the case when a dedicated P2P device
interface is used.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
---
 wpa_supplicant/ctrl_iface.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Jouni Malinen July 8, 2017, 7:34 p.m. UTC | #1
On Wed, Jul 05, 2017 at 09:25:05PM +0300, Andrei Otcheretianski wrote:
> Move the clearing of the get_pref_freq_list_override to
> p2p_ctrl_flush(). This fixes the case when a dedicated P2P device
> interface is used.

Thanks, applied. Though, I did not move this, but left it in both
functions just in case.
diff mbox

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 5bd9d08..cc8b1a8 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -6573,6 +6573,12 @@  static void p2p_ctrl_flush(struct wpa_supplicant *wpa_s)
 {
 	os_memset(wpa_s->p2p_auth_invite, 0, ETH_ALEN);
 	wpa_s->force_long_sd = 0;
+
+#ifdef CONFIG_TESTING_OPTIONS
+	os_free(wpa_s->get_pref_freq_list_override);
+	wpa_s->get_pref_freq_list_override = NULL;
+#endif
+
 	wpas_p2p_stop_find(wpa_s);
 	wpa_s->parent->p2ps_method_config_any = 0;
 	if (wpa_s->global->p2p)
@@ -7665,8 +7671,6 @@  static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
 	wpa_s->ignore_assoc_disallow = 0;
 	wpa_s->reject_btm_req_reason = 0;
 	wpa_sm_set_test_assoc_ie(wpa_s->wpa, NULL);
-	os_free(wpa_s->get_pref_freq_list_override);
-	wpa_s->get_pref_freq_list_override = NULL;
 #endif /* CONFIG_TESTING_OPTIONS */
 
 	wpa_s->disconnected = 0;