Prev: Office of Tim Pullen Solicitors & Barristers
Next: [tip:perf/urgent] perf: Fix resource leak in failure path of perf_event_open()
From: Tejun Heo on 1 May 2010 04:20 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: Tejun Heo <tj(a)kernel.org> Cc: Peter Zijlstra <a.p.zijlstra(a)chello.nl> Cc: Paul Mackerras <paulus(a)samba.org> Cc: Ingo Molnar <mingo(a)elte.hu> Cc: Arnaldo Carvalho de Melo <acme(a)redhat.com> --- kernel/perf_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: work/kernel/perf_event.c =================================================================== --- work.orig/kernel/perf_event.c +++ work/kernel/perf_event.c @@ -4897,7 +4897,7 @@ err_fput_free_put_context: err_free_put_context: if (err < 0) - kfree(event); + free_event(event); err_put_context: if (err < 0) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |