]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/x86/kernel/early_printk.c
x86: early_printk: Protect against using the same device twice
[net-next-2.6.git] / arch / x86 / kernel / early_printk.c
index 2acfd3fdc0cc0b37c139595e77c8558754c62ea9..41fd965c80c6d41caefd801ee16948d23214d905 100644 (file)
@@ -178,6 +178,11 @@ asmlinkage void early_printk(const char *fmt, ...)
 
 static inline void early_console_register(struct console *con, int keep_early)
 {
+       if (early_console->index != -1) {
+               printk(KERN_CRIT "ERROR: earlyprintk= %s already used\n",
+                      con->name);
+               return;
+       }
        early_console = con;
        if (keep_early)
                early_console->flags &= ~CON_BOOT;