Skip to content

Commit

Permalink
stacktrace: don't crash on invalid stack trace structs
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
jmberg authored and KAGA-KOKO committed May 23, 2008
1 parent 75d3bce commit bfeeeeb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ void print_stack_trace(struct stack_trace *trace, int spaces)
{
int i, j;

if (WARN_ON(!trace->entries))
return;

for (i = 0; i < trace->nr_entries; i++) {
unsigned long ip = trace->entries[i];

Expand Down

0 comments on commit bfeeeeb

Please sign in to comment.