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.
Showing the changes to kernel/stacktrace.c (1 of 1 file). Show all
Unified · Split
| @@ -13,6 +13,9 @@ void print_stack_trace(struct stack_trace *trace, int spaces) · 12 unmodified lines | ||
| 13 | 13 | { |
| 14 | 14 | int i, j; |
| 15 | 15 | |
| 16 | + if (WARN_ON(!trace->entries)) | |
| 17 | + return; | |
| 18 | + | |
| 16 | 19 | for (i = 0; i < trace->nr_entries; i++) { |
| 17 | 20 | unsigned long ip = trace->entries[i]; |
| 18 | 21 | |