[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1455302232-2252-4-git-send-email-sergey.senozhatsky@gmail.com>
Date: Sat, 13 Feb 2016 03:37:12 +0900
From: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Petr Mladek <pmladek@...e.com>, Jan Kara <jack@...e.com>,
Tejun Heo <tj@...nel.org>, Kyle McMartin <kyle@...nel.org>,
Dave Jones <davej@...emonkey.org.uk>,
Calvin Owens <calvinowens@...com>,
linux-kernel@...r.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Subject: [PATCH v4 3/3] printk: check CON_ENABLED in have_callable_console()
have_callable_console() must also test CON_ENABLED bit, not just
CON_ANYTIME. We may have disabled CON_ANYTIME console so printk
can wrongly assume that it's safe to call_console_drivers().
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
---
kernel/printk/printk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 9f0c3e1..9917f69 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2139,7 +2139,8 @@ static int have_callable_console(void)
struct console *con;
for_each_console(con)
- if (con->flags & CON_ANYTIME)
+ if ((con->flags & CON_ENABLED) &&
+ (con->flags & CON_ANYTIME))
return 1;
return 0;
--
2.7.1
Powered by blists - more mailing lists