mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
qcacld-3.0: Avoid mem leak during con_mode change
If any userspace request is posted using request manager, memory is allocated for that request using hdd_request_alloc api. Now when the response of this request comes in the registered callback, if this response is NULL then callback returns without doing hdd_request_complete and eventually request gets timed out and memory is released through request_put. If the con_mode is changed before this time out occures, con_mode_handler will try to stop_modules and will result in mem leak detection as the memory for the request is not released yet. To address this issue in con_mode_handler, wait for all the user space requests to complete before trying to stop modules. Change-Id: If524580e420d107a1fe6d17b75d4c13e4feb96e1 CRs-Fixed: 2244739
This commit is contained in:
parent
fa9f1b05e7
commit
759b327f8f
1 changed files with 5 additions and 0 deletions
|
|
@ -12646,6 +12646,11 @@ static int con_mode_handler(const char *kmessage, const struct kernel_param *kp)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!cds_wait_for_external_threads_completion(__func__)) {
|
||||
hdd_warn("External threads are still active, can not change mode");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
cds_ssr_protect(__func__);
|
||||
ret = __con_mode_handler(kmessage, kp, hdd_ctx);
|
||||
cds_ssr_unprotect(__func__);
|
||||
|
|
|
|||
Loading…
Reference in a new issue