提交 048c8520 编写于 作者: T Tejun Heo 提交者: Ingo Molnar

perf: Fix resource leak in failure path of perf_event_open()

perf_event_open() kfrees event after init failure which doesn't
release all resources allocated by perf_event_alloc().  Use
free_event() instead.
Signed-off-by: NTejun Heo <tj@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@au1.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: <stable@kernel.org>
LKML-Reference: <4BDBE237.1040809@kernel.org>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 66f41d4c
...@@ -4897,7 +4897,7 @@ SYSCALL_DEFINE5(perf_event_open, ...@@ -4897,7 +4897,7 @@ SYSCALL_DEFINE5(perf_event_open,
err_free_put_context: err_free_put_context:
if (err < 0) if (err < 0)
kfree(event); free_event(event);
err_put_context: err_put_context:
if (err < 0) if (err < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册