[tip:perf/urgent] perf: Don't call release_callchain_buffers() if allocation fails
From: tip-bot for Namhyung Kim
Date: Sun Jan 22 2012 - 16:09:24 EST
Commit-ID: fd45c15f13e754f3c106427e857310f3e0813951
Gitweb: http://git.kernel.org/tip/fd45c15f13e754f3c106427e857310f3e0813951
Author: Namhyung Kim <namhyung.kim@xxxxxxx>
AuthorDate: Fri, 20 Jan 2012 10:12:45 +0900
Committer: Ingo Molnar <mingo@xxxxxxx>
CommitDate: Sat, 21 Jan 2012 09:33:41 +0100
perf: Don't call release_callchain_buffers() if allocation fails
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@xxxxxxx>
Acked-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxxxx>
Link: http://lkml.kernel.org/r/1327021966-27688-1-git-send-email-namhyung.kim@xxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
kernel/events/callchain.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/kernel/events/callchain.c b/kernel/events/callchain.c
index 057e24b..6581a04 100644
--- a/kernel/events/callchain.c
+++ b/kernel/events/callchain.c
@@ -115,8 +115,6 @@ int get_callchain_buffers(void)
}
err = alloc_callchain_buffers();
- if (err)
- release_callchain_buffers();
exit:
mutex_unlock(&callchain_mutex);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/