Commit adaf6590 authored by Sergey Senozhatsky's avatar Sergey Senozhatsky Committed by Linus Torvalds

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: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
Cc: Jan Kara <jack@suse.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Kyle McMartin <kyle@kernel.org>
Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Calvin Owens <calvinowens@fb.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6b97a20d
...@@ -2146,7 +2146,8 @@ static int have_callable_console(void) ...@@ -2146,7 +2146,8 @@ static int have_callable_console(void)
struct console *con; struct console *con;
for_each_console(con) for_each_console(con)
if (con->flags & CON_ANYTIME) if ((con->flags & CON_ENABLED) &&
(con->flags & CON_ANYTIME))
return 1; return 1;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment