aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorMasami Hiramatsu <[email protected]>2020-07-10 22:11:23 +0900
committerArnaldo Carvalho de Melo <[email protected]>2020-07-17 09:09:46 -0300
commit12d572e785b15bc764e956caaa8a4c846fd15694 (patch)
treed0a2ec8157a386d7d24043cda48c4855bdd6770d /tools/perf/scripts/python/stackcollapse.py
parent11fd3eb874e73ee8069bcfd54e3c16fa7ce56fe6 (diff)
perf probe: Fix memory leakage when the probe point is not found
Fix the memory leakage in debuginfo__find_trace_events() when the probe point is not found in the debuginfo. If there is no probe point found in the debuginfo, debuginfo__find_probes() will NOT return -ENOENT, but 0. Thus the caller of debuginfo__find_probes() must check the tf.ntevs and release the allocated memory for the array of struct probe_trace_event. The current code releases the memory only if the debuginfo__find_probes() hits an error but not checks tf.ntevs. In the result, the memory allocated on *tevs are not released if tf.ntevs == 0. This fixes the memory leakage by checking tf.ntevs == 0 in addition to ret < 0. Fixes: ff741783506c ("perf probe: Introduce debuginfo to encapsulate dwarf information") Signed-off-by: Masami Hiramatsu <[email protected]> Reviewed-by: Srikar Dronamraju <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: [email protected] Link: http://lore.kernel.org/lkml/159438668346.62703.10887420400718492503.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions