aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2012-03-29 07:17:17 -0400
committerJason Wessel <jason.wessel@windriver.com>2012-03-29 18:41:23 -0400
commit78724b8ef83fc2bcfbc0a72a7ad8a3ce5ad25e6a (patch)
treef1f9bfae9d197765d361779a458aa1dfdb135193 /kernel
parent1ba0c1720eb0de2d0f3abf84c0b128d10af520d1 (diff)
kdb: Fix smatch warning on dbg_io_ops->is_console
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. CC: Tim Bird <tim.bird@am.sony.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/debug/kdb/kdb_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c
index 9b5f17da1c56..bb9520f0f6ff 100644
--- a/kernel/debug/kdb/kdb_io.c
+++ b/kernel/debug/kdb/kdb_io.c
@@ -743,7 +743,7 @@ kdb_printit:
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--) {