[PATCH] P2P: Disconnect P2P group on supplicant deinit
nirav shah
nirav.j2.shah
Thu Mar 22 09:17:36 PDT 2012
When a supplicant is deinited and shutting, adding code to disconnect
from p2p_group. Found root causing the memory leak on variable
dbus_groupobj_path on exiting supplicant.
Signed-hostap: Nirav Shah <nirav.j2.shah at intel.com>
Signed-hostap: Angie Chinchilla <angie.v.chinchilla at intel.com>
---
wpa_supplicant/wpa_supplicant.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 4c365dd..2b82a46 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2570,6 +2570,18 @@ next_driver:
static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s,
int notify, int terminate)
{
+
+#ifdef CONFIG_P2P
+ if (wpa_s && wpa_s->p2p_group_interface != NOT_P2P_GROUP_INTERFACE) {
+ /* This is a p2p interface */
+ wpa_printf(MSG_DEBUG, "P2P: Disconnecting the P2P group %s",
+ wpa_s->dbus_groupobj_path);
+ /* Disconnect from the p2p group if any */
+ wpas_p2p_disconnect(wpa_s);
+ }
+#endif /* CONFIG_P2P */
+
+
if (wpa_s->drv_priv) {
wpa_supplicant_deauthenticate(wpa_s,
WLAN_REASON_DEAUTH_LEAVING);
--
1.7.4.1
More information about the Hostap
mailing list