From 6edafeb0c305c41d056f09dc0f6209b009c18cca Mon Sep 17 00:00:00 2001 From: Kabilan Kannan Date: Thu, 16 Nov 2017 16:34:34 -0800 Subject: [PATCH] qcacld-3.0: Free user defined WOWL patterns User defined wowl patterns are not freed in all of the driver unload paths, and it causes leaks in the system. Free user defined wowl patterns in all the driver unload paths. Change-Id: I7b980a6392badb3d28f2c665a96108beb71f02d5 CRs-Fixed: 2144562 --- core/hdd/inc/wlan_hdd_wowl.h | 4 ++-- core/hdd/src/wlan_hdd_main.c | 4 +++- core/hdd/src/wlan_hdd_wowl.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_wowl.h b/core/hdd/inc/wlan_hdd_wowl.h index 2aabcbdb17b6..d039664b3a26 100644 --- a/core/hdd/inc/wlan_hdd_wowl.h +++ b/core/hdd/inc/wlan_hdd_wowl.h @@ -174,10 +174,10 @@ bool hdd_enter_wowl(struct hdd_adapter *adapter, bool hdd_exit_wowl(struct hdd_adapter *adapter); /** - * hdd_deinit_wowl() - Deinit function to cleanup WoWL allocated memory + * hdd_free_user_wowl_ptrns() - Deinit function to cleanup WoWL allocated memory * * Return: None */ -void hdd_deinit_wowl(void); +void hdd_free_user_wowl_ptrns(void); #endif /* #ifndef _WLAN_HDD_WOWL_H */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 14343d11dbbd..710b94fa8d61 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9605,6 +9605,9 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) hdd_info("Present Driver Status: %d", hdd_ctx->driver_status); + /* free user wowl patterns */ + hdd_free_user_wowl_ptrns(); + switch (hdd_ctx->driver_status) { case DRIVER_MODULES_UNINITIALIZED: hdd_info("Modules not initialized just return"); @@ -11097,7 +11100,6 @@ err_out: */ void hdd_deinit(void) { - hdd_deinit_wowl(); qdf_timer_free(&hdd_drv_ops_inactivity_timer); wlan_destroy_bug_report_lock(); diff --git a/core/hdd/src/wlan_hdd_wowl.c b/core/hdd/src/wlan_hdd_wowl.c index 5773b9ab42a2..6b58a263ffa0 100644 --- a/core/hdd/src/wlan_hdd_wowl.c +++ b/core/hdd/src/wlan_hdd_wowl.c @@ -527,7 +527,7 @@ bool hdd_exit_wowl(struct hdd_adapter *adapter) return true; } -void hdd_deinit_wowl(void) +void hdd_free_user_wowl_ptrns(void) { int i;