]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/serial/mpc52xx_uart.c: fix array overindexing check
authorRoel Kluin <roel.kluin@gmail.com>
Thu, 28 May 2009 21:34:29 +0000 (14:34 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Jun 2009 16:40:03 +0000 (09:40 -0700)
commit b898f4f869da5b9d41f297fff87aca4cd42d80b3 upstream.

The check for an overindexing of mpc52xx_uart_{ports,nodes} has an
off-by-one.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/serial/mpc52xx_uart.c

index 28d2c8d3771f61d9588bb11f9465d92e0f3b3507..28b07ce41347a8e754cbd1aa0c2ab5930b4d7937 100644 (file)
@@ -988,7 +988,7 @@ mpc52xx_console_setup(struct console *co, char *options)
        pr_debug("mpc52xx_console_setup co=%p, co->index=%i, options=%s\n",
                 co, co->index, options);
 
-       if ((co->index < 0) || (co->index > MPC52xx_PSC_MAXNUM)) {
+       if ((co->index < 0) || (co->index >= MPC52xx_PSC_MAXNUM)) {
                pr_debug("PSC%x out of range\n", co->index);
                return -EINVAL;
        }