aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-05-12 15:21:14 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 19:16:38 -0400
commitbfeeeeb991cf75081e6c2f74d44ae5da05b50a94 (patch)
tree3497ab932a0e6be36e0f28fb9adb75698e243f3b /kernel
parent75d3bce2fc0a80f435fe12f2c9ed2632c8ac29e4 (diff)
stacktrace: don't crash on invalid stack trace structs
This patch makes the stacktrace printout code \warn when the entries pointer is unset rather than crashing when trying to access it in an attempt to make it a bit more robust. I was saving a stacktrace into an skb and forgot to copy it across skb copies... I have since fixed the code, but it would have been easier had the kernel not crashed in an interrupt. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/stacktrace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c
index b71816e47a30..0914d0cbc83c 100644
--- a/kernel/stacktrace.c
+++ b/kernel/stacktrace.c
@@ -13,6 +13,9 @@ void print_stack_trace(struct stack_trace *trace, int spaces)
13{ 13{
14 int i, j; 14 int i, j;
15 15
16 if (WARN_ON(!trace->entries))
17 return;
18
16 for (i = 0; i < trace->nr_entries; i++) { 19 for (i = 0; i < trace->nr_entries; i++) {
17 unsigned long ip = trace->entries[i]; 20 unsigned long ip = trace->entries[i];
18 21