From a6246dd4e5551ee907e44a566c4e6e33fea4b391 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Thu, 24 May 2018 14:35:58 -0700 Subject: [PATCH] qcacld-3.0: Check vdevs in hdd_check_for_leaks Before checking for other kinds of resources leaks, check to ensure all objmgr vdevs have been properly freed. Change-Id: Ie30daf22834ceb4a8ce19fbd1d4c9b231d3b70d4 CRs-Fixed: 2255511 --- core/hdd/src/wlan_hdd_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index b5f7eac17ac0..e53b57273bd8 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2602,6 +2602,7 @@ static void hdd_nan_register_callbacks(struct hdd_context *hdd_ctx) #ifdef CONFIG_LEAK_DETECTION /** * hdd_check_for_leaks() - Perform runtime memory leak checks + * @hdd_ctx: the global HDD context * * This API triggers runtime memory leak detection. This feature enforces the * policy that any memory allocated at runtime must also be released at runtime. @@ -2613,10 +2614,11 @@ static void hdd_nan_register_callbacks(struct hdd_context *hdd_ctx) * * Return: None */ -static void hdd_check_for_leaks(void) +static void hdd_check_for_leaks(struct hdd_context *hdd_ctx) { /* DO NOT REMOVE these checks; for false positives, read above first */ + wlan_objmgr_psoc_check_for_vdev_leaks(hdd_ctx->hdd_psoc); qdf_mc_timer_check_for_leaks(); qdf_nbuf_map_check_for_leaks(); qdf_mem_check_for_leaks(); @@ -2624,7 +2626,7 @@ static void hdd_check_for_leaks(void) #define hdd_debug_domain_set(domain) qdf_debug_domain_set(domain) #else -static inline void hdd_check_for_leaks(void) {} +static inline void hdd_check_for_leaks(struct hdd_context *hdd_ctx) { } #define hdd_debug_domain_set(domain) #endif /* CONFIG_LEAK_DETECTION */ @@ -2875,7 +2877,7 @@ release_lock: } /* many adapter resources are not freed by design in SSR case */ if (!reinit) - hdd_check_for_leaks(); + hdd_check_for_leaks(hdd_ctx); hdd_debug_domain_set(QDF_DEBUG_DOMAIN_INIT); hdd_exit(); @@ -10633,7 +10635,7 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) /* many adapter resources are not freed by design in SSR case */ if (!is_recovery_stop) - hdd_check_for_leaks(); + hdd_check_for_leaks(hdd_ctx); hdd_debug_domain_set(QDF_DEBUG_DOMAIN_INIT); /* Once the firmware sequence is completed reset this flag */