The Smatch tool warned that the change from commit b8adde8dd (kdb: Avoid using dbg_io_ops until it is initialized) should add another null check later in the kdb_printf(). It is worth noting that the second use of dbg_io_ops->is_console is protected by the KDB_PAGER state variable which would only get set when kdb is fully active and initialized. If we ever encounter changes or defects in the KDB_PAGER state we do not want to crash the kernel in a kdb_printf/printk.
Showing the changes to kernel/debug (1 of 1 file). Show all
Unified · Split
| @@ -743,7 +743,7 @@ kdb_printit: · 742 unmodified lines | |||
| 743 | kdb_input_flush(); | 743 | kdb_input_flush(); |
| 744 | c = console_drivers; | 744 | c = console_drivers; |
| 745 | 745 | ||
| 746 | if (!dbg_io_ops->is_console) { | 746 | if (dbg_io_ops && !dbg_io_ops->is_console) { |
| 747 | len = strlen(moreprompt); | 747 | len = strlen(moreprompt); |
| 748 | cp = moreprompt; | 748 | cp = moreprompt; |
| 749 | while (len--) { | 749 | while (len--) { |