diff options
author | Wenwen Wang <[email protected]> | 2019-04-19 21:22:59 -0500 |
---|---|---|
committer | Steven Rostedt (VMware) <[email protected]> | 2019-04-26 11:45:03 -0400 |
commit | 91862cc7867bba4ee5c8fcf0ca2f1d30427b6129 (patch) | |
tree | e86c2be2969fddc37d14081504b90df8aab8c145 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | b987222654f84f7b4ca95b3a55eca784cb30235b (diff) |
tracing: Fix a memory leak by early error exit in trace_pid_write()
In trace_pid_write(), the buffer for trace parser is allocated through
kmalloc() in trace_parser_get_init(). Later on, after the buffer is used,
it is then freed through kfree() in trace_parser_put(). However, it is
possible that trace_pid_write() is terminated due to unexpected errors,
e.g., ENOMEM. In that case, the allocated buffer will not be freed, which
is a memory leak bug.
To fix this issue, free the allocated buffer when an error is encountered.
Link: http://lkml.kernel.org/r/[email protected]
Fixes: f4d34a87e9c10 ("tracing: Use pid bitmap instead of a pid array for set_event_pid")
Cc: [email protected]
Signed-off-by: Wenwen Wang <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions