Skip to content
Commit 83540fbc authored by Jann Horn's avatar Jann Horn Committed by Steven Rostedt (VMware)
Browse files

tracing/perf: Use strndup_user() instead of buggy open-coded version

The first version of this method was missing the check for
`ret == PATH_MAX`; then such a check was added, but it didn't call kfree()
on error, so there was still a small memory leak in the error case.
Fix it by using strndup_user() instead of open-coding it.

Link: http://lkml.kernel.org/r/20190220165443.152385-1-jannh@google.com

Cc: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
Fixes: 0eadcc7a

 ("perf/core: Fix perf_uprobe_init()")
Reviewed-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarJann Horn <jannh@google.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent b689269b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment