linux-stable/kernel/printk
Andreas Bießmann 16cf48a6d3 register_console: prevent adding the same console twice
This patch guards the console_drivers list to be corrupted. The
for_each_console() macro insist on a strictly forward list ended by NULL:

 con0->next->con1->next->NULL

Without this patch it may happen easily to destroy this list for example by
adding 'earlyprintk' twice, especially on embedded devices where the early
console is often a single static instance.  This will result in the following
list:

 con0->next->con0

This in turn will result in an endless loop in console_unlock() later on by
printing the first __log_buf line endlessly.

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
Cc: Kay Sievers <kay@vrfy.org>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-05 15:06:46 +08:00
..
braille.c printk: move braille console support into separate braille.[ch] files 2013-07-31 14:41:03 -07:00
braille.h printk: move braille console support into separate braille.[ch] files 2013-07-31 14:41:03 -07:00
console_cmdline.h printk: add console_cmdline.h 2013-07-31 14:41:03 -07:00
Makefile printk: move braille console support into separate braille.[ch] files 2013-07-31 14:41:03 -07:00
printk.c register_console: prevent adding the same console twice 2013-08-05 15:06:46 +08:00