Skip to content

Commit 578bd4d

Browse files
committed
kdb: Fix early debugging crash regression
The kdb_current legally be equal to NULL in the early boot of the x86 arch. The problem pcan be observed by booting with the kernel arguments: earlyprintk=vga ekgdboc=kbd kgdbwait The kdb shell will oops on entry and recursively fault because it cannot get past the final stage of shell initialization. Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
1 parent 834b296 commit 578bd4d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/debug/kdb/kdb_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
11271127
/* special case below */
11281128
} else {
11291129
kdb_printf("\nEntering kdb (current=0x%p, pid %d) ",
1130-
kdb_current, kdb_current->pid);
1130+
kdb_current, kdb_current ? kdb_current->pid : 0);
11311131
#if defined(CONFIG_SMP)
11321132
kdb_printf("on processor %d ", raw_smp_processor_id());
11331133
#endif

0 commit comments

Comments
 (0)