Merge branch 'nfsd-next' of git://linux-nfs.org/~bfields/linux
[cascardo/linux.git] / kernel / printk / printk.c
index 5b5a708..b4e8500 100644 (file)
@@ -2226,6 +2226,13 @@ void register_console(struct console *newcon)
        struct console *bcon = NULL;
        struct console_cmdline *c;
 
+       if (console_drivers)
+               for_each_console(bcon)
+                       if (WARN(bcon == newcon,
+                                       "console '%s%d' already registered\n",
+                                       bcon->name, bcon->index))
+                               return;
+
        /*
         * before we register a new CON_BOOT console, make sure we don't
         * already have a valid console