]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
perf: Don't call release_callchain_buffers() if allocation fails
authorNamhyung Kim <namhyung.kim@lge.com>
Fri, 20 Jan 2012 01:12:45 +0000 (10:12 +0900)
committerIngo Molnar <mingo@elte.hu>
Sat, 21 Jan 2012 08:33:41 +0000 (09:33 +0100)
When alloc_callchain_buffers() fails, it frees all of
entries before return. In addition, calling the
release_callchain_buffers() will cause a NULL pointer
dereference since callchain_cpu_entries is not set.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Link: http://lkml.kernel.org/r/1327021966-27688-1-git-send-email-namhyung.kim@lge.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/events/callchain.c

index 057e24b665cf7f5633bc43b752202af38c14d413..6581a040f39926dd46878640413bfd180922415a 100644 (file)
@@ -115,8 +115,6 @@ int get_callchain_buffers(void)
        }
 
        err = alloc_callchain_buffers();
-       if (err)
-               release_callchain_buffers();
 exit:
        mutex_unlock(&callchain_mutex);