serial8250: sanity check nr_uarts on all paths.
[safe/jmp/linux-2.6] / drivers / serial / 8250.c
index 1bc00b7..be95e55 100644 (file)
@@ -2623,6 +2623,9 @@ static struct console serial8250_console = {
 
 static int __init serial8250_console_init(void)
 {
+       if (nr_uarts > UART_NR)
+               nr_uarts = UART_NR;
+
        serial8250_isa_init_ports();
        register_console(&serial8250_console);
        return 0;