diff mbox

[1/2] P2P: Flush services based on global p2p init and not p2p ifaces

Message ID 1411246261-10328-2-git-send-email-eduardo.abinader@openbossa.org
State Accepted
Headers show

Commit Message

Eduardo Abinader Sept. 20, 2014, 8:51 p.m. UTC
As P2P service are not necessarily attached to a iface, when
added, proceed with same approach on p2p global deinit. Such
approach solves memory leaks ocurring upon wpa_supplicant
termination, when p2p services were registered previously.

Signed-off-by: Eduardo Abinader <eduardo.abinader@openbossa.org>
---
 wpa_supplicant/p2p_supplicant.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jouni Malinen Sept. 28, 2014, 8:20 a.m. UTC | #1
On Sat, Sep 20, 2014 at 04:51:00PM -0400, Eduardo Abinader wrote:
> As P2P service are not necessarily attached to a iface, when
> added, proceed with same approach on p2p global deinit. Such
> approach solves memory leaks ocurring upon wpa_supplicant
> termination, when p2p services were registered previously.

Thanks, both patches applied.
diff mbox

Patch

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index e1a384b..c64665d 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -4077,8 +4077,8 @@  static void wpas_p2p_deinit_global(struct wpa_global *global)
 	struct wpa_supplicant *wpa_s, *tmp;
 
 	wpa_s = global->ifaces;
-	if (wpa_s)
-		wpas_p2p_service_flush(wpa_s);
+
+	wpas_p2p_service_flush(global->p2p_init_wpa_s);
 
 	if (global->p2p == NULL)
 		return;