Skip to contentSkip to conversation

powerpc/5200: beyond ARRAY_SIZE of mpc52xx_uart_{ports, nodes}

PATCH In review Roel Kluin 2 participants 2 messages May 20, 2009

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 powerpc/5200: beyond ARRAY_SIZE of mpc52xx_uart_{ports, nodes}

Do not go beyond ARRAY_SIZE of mpc52xx_uart_{ports,nodes}

---

drivers/serial/mpc52xx_uart.c +1 -1
index 7f72f8c..b3feb61 100644
@@ -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;
 	}
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Roel Kluin

Do not go beyond ARRAY_SIZE of mpc52xx_uart_{ports,nodes}

Quoted 18 lines

---

drivers/serial/mpc52xx_uart.c +1 -1
index 7f72f8c..b3feb61 100644
@@ -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;
 	}

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |