printk: Flag register_console() if console is set on command line
authorTony Lindgren <tony@atomide.com>
Wed, 27 Mar 2024 10:59:37 +0000 (12:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Apr 2024 13:30:13 +0000 (15:30 +0200)
commitb73c9cbe4f1fc02645228aa575998dd54067f8ef
tree78744490609a7ca67b8432344b5059372e35f700
parent8a831c584e6e80cf68f79893dc395c16cdf47dc8
printk: Flag register_console() if console is set on command line

If add_preferred_console() is not called early in setup_console(), we can
end up having register_console() call try_enable_default_console() before a
console device has called add_preferred_console().

Let's set console_set_on_cmdline flag in console_setup() to prevent this
from happening.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20240327110021.59793-4-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/printk/printk.c