History

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.

Johannes Berg committed 18 years ago

Commit bfeeeeb1 parent 75d3bce1 file · +3 −0Browse files

Showing the changes to kernel/stacktrace.c (1 of 1 file). Show all

Unified · Split

kernel/stacktrace.c+3−0
@@ -13,6 +13,9 @@ void print_stack_trace(struct stack_trace *trace, int spaces) · 12 unmodified lines
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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t