fix oops when using console=ttymxcN with N > 0
authorEric Lammerts <linux-arm@lists.lammerts.org>
Wed, 20 May 2009 00:53:20 +0000 (20:53 -0400)
committerSascha Hauer <s.hauer@pengutronix.de>
Wed, 20 May 2009 17:09:20 +0000 (19:09 +0200)
Signed-off-by: Eric Lammerts <eric@lammerts.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
drivers/serial/imx.c

index 3f5d5a2..738c8a5 100644 (file)
@@ -1024,6 +1024,8 @@ imx_console_setup(struct console *co, char *options)
        if (co->index == -1 || co->index >= ARRAY_SIZE(imx_ports))
                co->index = 0;
        sport = imx_ports[co->index];
+       if(sport == NULL)
+               return -ENODEV;
 
        if (options)
                uart_parse_options(options, &baud, &parity, &bits, &flow);