diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 70319000c20b..5f810fd8aca4 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -3481,6 +3481,17 @@ void hdd_component_pdev_close(struct wlan_objmgr_pdev *pdev); #ifdef WLAN_FEATURE_MEMDUMP_ENABLE int hdd_driver_memdump_init(void); void hdd_driver_memdump_deinit(void); + +/** + * hdd_driver_mem_cleanup() - Frees memory allocated for + * driver dump + * + * This function frees driver dump memory. + * + * Return: None + */ +void hdd_driver_mem_cleanup(void); + #else /* WLAN_FEATURE_MEMDUMP_ENABLE */ static inline int hdd_driver_memdump_init(void) { @@ -3489,6 +3500,10 @@ static inline int hdd_driver_memdump_init(void) static inline void hdd_driver_memdump_deinit(void) { } + +static inline void hdd_driver_mem_cleanup(void) +{ +} #endif /* WLAN_FEATURE_MEMDUMP_ENABLE */ /** * hdd_set_disconnect_status() - set adapter disconnection status diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 08e02a28844a..b354f2b5348c 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -11897,6 +11897,7 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) /* Free the cache channels of the command SET_DISABLE_CHANNEL_LIST */ wlan_hdd_free_cache_channels(hdd_ctx); + hdd_driver_mem_cleanup(); /* Free the resources allocated while storing SAR config. These needs * to be freed only in the case when it is not SSR. As in the case of diff --git a/core/hdd/src/wlan_hdd_memdump.c b/core/hdd/src/wlan_hdd_memdump.c index 7399a73513a1..954a574f02b9 100644 --- a/core/hdd/src/wlan_hdd_memdump.c +++ b/core/hdd/src/wlan_hdd_memdump.c @@ -59,15 +59,7 @@ static void *memdump_get_file_data(struct file *file) return hdd_ctx; } -/** - * hdd_driver_mem_cleanup() - Frees memory allocated for - * driver dump - * - * This function unallocates driver dump memory. - * - * Return: None - */ -static void hdd_driver_mem_cleanup(void) +void hdd_driver_mem_cleanup(void) { struct hdd_context *hdd_ctx; @@ -310,6 +302,4 @@ int hdd_driver_memdump_init(void) void hdd_driver_memdump_deinit(void) { hdd_driver_memdump_procfs_remove(); - - hdd_driver_mem_cleanup(); }