diff options
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 1 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_memdump.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 38bac4b2ce5a..94f1eb0dbe3b 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1442,6 +1442,7 @@ struct hdd_context_s { qdf_mc_timer_t memdump_cleanup_timer; struct mutex memdump_lock; bool memdump_in_progress; + bool memdump_init_done; #endif /* WLAN_FEATURE_MEMDUMP */ bool connection_in_progress; diff --git a/core/hdd/src/wlan_hdd_memdump.c b/core/hdd/src/wlan_hdd_memdump.c index b6a3ccb1f9c8..1afe3fd7569c 100644 --- a/core/hdd/src/wlan_hdd_memdump.c +++ b/core/hdd/src/wlan_hdd_memdump.c @@ -565,6 +565,7 @@ int memdump_init(void) } mutex_init(&hdd_ctx->memdump_lock); + hdd_ctx->memdump_init_done = true; return 0; } @@ -595,6 +596,12 @@ void memdump_deinit(void) return; } + if (!hdd_ctx->memdump_init_done) { + hdd_err("MemDump not initialized"); + return; + } + hdd_ctx->memdump_init_done = false; + qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); if (!qdf_ctx) { hdd_err("QDF context is NULL"); @@ -612,6 +619,7 @@ void memdump_deinit(void) hdd_ctx->memdump_in_progress = false; } mutex_unlock(&hdd_ctx->memdump_lock); + mutex_destroy(&hdd_ctx->memdump_lock); if (QDF_TIMER_STATE_RUNNING == qdf_mc_timer_get_current_state(&hdd_ctx->memdump_cleanup_timer)) { |
