Skip to content

Commit b8adde8

Browse files
Tim Birdjwessel
authored andcommitted
kdb: Avoid using dbg_io_ops until it is initialized
This fixes a bug with setting a breakpoint during kdb initialization (from kdb_cmds). Any call to kdb_printf() before the initialization of the kgdboc serial console driver (which happens much later during bootup than kdb_init), results in kernel panic due to the use of dbg_io_ops before it is initialized. Signed-off-by: Tim Bird <tim.bird@am.sony.com> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
1 parent bec4d62 commit b8adde8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/debug/kdb/kdb_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ int vkdb_printf(const char *fmt, va_list ap)
689689
if (!dbg_kdb_mode && kgdb_connected) {
690690
gdbstub_msg_write(kdb_buffer, retlen);
691691
} else {
692-
if (!dbg_io_ops->is_console) {
692+
if (dbg_io_ops && !dbg_io_ops->is_console) {
693693
len = strlen(kdb_buffer);
694694
cp = kdb_buffer;
695695
while (len--) {

0 commit comments

Comments
 (0)