mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
qcacld-3.0: Deinit memdump only when it is initialized
During driver initialization, if hif_register_driver timeout then memdump is not initialized. Due to this timeout, unregister driver is called which deinitialize memdump which cause crash as uninitialized mutex is accessed in memdump_deinit. To fix this issue, deinit memdump only when the init is successful. Change-Id: I781717a2a160aa09c9f60ebface1238507d1a623 CRs-Fixed: 991443 (cherry picked from commit 54eda9379d7dec74ac6c3efd1659dffdd32c0680)
This commit is contained in:
parent
0c6d507d28
commit
02dd2e71c5
2 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue