diff options
author | Steven Rostedt (Red Hat) <[email protected]> | 2016-01-05 20:32:47 -0500 |
---|---|---|
committer | Steven Rostedt <[email protected]> | 2016-01-07 12:17:39 -0500 |
commit | 049fb9bd416077b3622d317a45796be4f2431df3 (patch) | |
tree | 407e360324e0370e8a4e73e15de76959e6ea1f24 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | f36d1be2930ede0a1947686e1126ffda5d5ee1bb (diff) |
ftrace/module: Call clean up function when module init fails early
If the module init code fails after calling ftrace_module_init() and before
calling do_init_module(), we can suffer from a memory leak. This is because
ftrace_module_init() allocates pages to store the locations that ftrace
hooks are placed in the module text. If do_init_module() fails, it still
calls the MODULE_GOING notifiers which will tell ftrace to do a clean up of
the pages it allocated for the module. But if load_module() fails before
then, the pages allocated by ftrace_module_init() will never be freed.
Call ftrace_release_mod() on the module if load_module() fails before
getting to do_init_module().
Link: http://lkml.kernel.org/r/[email protected]
Reported-by: "Qiu, PeiyangX" <[email protected]>
Fixes: a949ae560a511 "ftrace/module: Hardcode ftrace_module_init() call into load_module()"
Cc: [email protected] # v2.6.38+
Acked-by: Rusty Russell <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions