From: Sergey Senozhatsky Date: Thu, 17 Mar 2016 21:21:27 +0000 (-0700) Subject: printk: check CON_ENABLED in have_callable_console() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=adaf6590ee7db23c3a124fb9f213c90c15cecf96;p=openwrt%2Fstaging%2Fblogic.git 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 Reviewed-by: Petr Mladek Cc: Jan Kara Cc: Tejun Heo Cc: Kyle McMartin Cc: Dave Jones Cc: Calvin Owens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index a6d023c3b852..d5fd844e5b08 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2146,7 +2146,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;