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:
Ashish Kumar Dhanotiya 2018-05-18 17:49:46 +05:30 • committed by nshrivas
commit 759b327f8f

View file

@ -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__);