Commit 578bd4dfcda63d2ef15f025f1d5d55c0e56b9660

Authored by Jason Wessel
1 parent 834b2964b7

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

kernel/debug/kdb/kdb_main.c
... ... @@ -1127,7 +1127,7 @@
1127 1127 /* special case below */
1128 1128 } else {
1129 1129 kdb_printf("\nEntering kdb (current=0x%p, pid %d) ",
1130   - kdb_current, kdb_current->pid);
  1130 + kdb_current, kdb_current ? kdb_current->pid : 0);
1131 1131 #if defined(CONFIG_SMP)
1132 1132 kdb_printf("on processor %d ", raw_smp_processor_id());
1133 1133 #endif