mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: <kgdb-bugreport@lists.sourceforge.net>
Subject: [PATCH 1/6] kdb: Fix smatch warning on dbg_io_ops->is_console
Date: Thu, 29 Mar 2012 17:48:57 -0500	[thread overview]
Message-ID: <1333061342-10132-2-git-send-email-jason.wessel@windriver.com> (raw)
In-Reply-To: <1333061342-10132-1-git-send-email-jason.wessel@windriver.com>

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>
---
 kernel/debug/kdb/kdb_io.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c
index 9b5f17d..bb9520f 100644
--- a/kernel/debug/kdb/kdb_io.c
+++ b/kernel/debug/kdb/kdb_io.c
@@ -743,7 +743,7 @@ kdb_printit:
 		kdb_input_flush();
 		c = console_drivers;
 
-		if (!dbg_io_ops->is_console) {
+		if (dbg_io_ops && !dbg_io_ops->is_console) {
 			len = strlen(moreprompt);
 			cp = moreprompt;
 			while (len--) {
-- 
1.7.9.4


  reply	other threads:[~2012-03-29 22:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29 22:48 [PATCH 0/6] KGDB/KDB/KGDBTS various regression fixes for 2.6.x -> 3.4 Jason Wessel
2012-03-29 22:48 ` Jason Wessel [this message]
2012-03-29 22:48 ` [PATCH 2/6] kgdbts: Fix kernel oops with CONFIG_DEBUG_RODATA Jason Wessel
2012-03-29 22:48 ` [PATCH 3/6] kgdbts: (1 of 2) fix single step awareness to work correctly with SMP Jason Wessel
2012-03-29 22:49 ` [PATCH 4/6] kgdbts: (2 " Jason Wessel
2012-03-29 22:49 ` [PATCH 5/6] kgdb,debug_core: pass the breakpoint struct instead of address and memory Jason Wessel
2012-03-29 22:49 ` [PATCH 6/6] x86,kgdb: Fix DEBUG_RODATA limitation using text_poke() Jason Wessel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333061342-10132-2-git-send-email-jason.wessel@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®