diff options
| author | Ashish Kumar Dhanotiya <adhanoti@codeaurora.org> | 2020-04-10 12:42:08 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2020-04-21 22:52:25 -0700 |
| commit | 3f9b53f6d4f6ea4f712a45fa0b13d6fd9203335a (patch) | |
| tree | d3a90549d9eca6c6c4aa1cc5f7b0fa47e781cb6f /tools/perf/scripts/python | |
| parent | 11c68af53c75a11e23ede3b98d6f373b859244a9 (diff) | |
qcacld-3.0: Set power stats response cb and context to NULL
Currently for below cases there is a possiblity of mem leak
in hdd_power_debugstats_cb:
1. If the power debug stats command is invoked
with multiple threads from userspace, in this case the thread
which invokes this command last, will over write the cookie
in the sme context. Now when FW sends the responses for both
the requests, hdd_power_debugstats_cb is invoked with the same
cookie and in the call back processing there is memory allocated
for the private data which will also be allocated twice and the
second mem alloc will over write the pointer of private data from
the memory allocated by the first mem alloc to second mem alloc.
This will result in the memory leak for the first mem alloc.
2. If FW sends multiple responses for a single power debug
stats command, there is a possiblity that memory can be
allocated multiple times in hdd_power_debugstats_cb for debug
registers as explained in point 1 and mem_free happens only once
leading to memory leak for the other instances where memory is
allocated.
3. Command gets invoked from userspace and cookie corresponding
to this command is stored in sme. If this command gets timed-out
user space thread is unblocked and if it again issues the same
command, cookie for this command is stored in sme which will
over write the cookie of the previous command. Now if FW sends
the response of both the commands back to back, in this case
the hdd_power_debugstats_cb will be invoked twice with the same
cookie and will lead to mem leak as mentioned in point 1.
To address above issue, hdd_power_debugstats_cb needs to be
invoked only once for one cookie, set the callback and the
cookie to NULL in sme after invoking the callback.
Change-Id: Id473fd8f6530c57cc1096fd942a11aaf374c815d
CRs-Fixed: 2664788
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
