linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/5200: beyond ARRAY_SIZE of mpc52xx_uart_{ports, nodes}
@ 2009-05-20  0:28 Roel Kluin
  2009-05-20  7:11 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-05-20  0:28 UTC (permalink / raw)
  To: grant.likely; +Cc: linuxppc-dev, Andrew Morton

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

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 7f72f8c..b3feb61 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -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;
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/5200: beyond ARRAY_SIZE of mpc52xx_uart_{ports, nodes}
  2009-05-20  0:28 [PATCH] powerpc/5200: beyond ARRAY_SIZE of mpc52xx_uart_{ports, nodes} Roel Kluin
@ 2009-05-20  7:11 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2009-05-20  7:11 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linuxppc-dev, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

On Wed, May 20, 2009 at 02:28:52AM +0200, Roel Kluin wrote:
> Do not go beyond ARRAY_SIZE of mpc52xx_uart_{ports,nodes}
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>

> ---
> diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
> index 7f72f8c..b3feb61 100644
> --- a/drivers/serial/mpc52xx_uart.c
> +++ b/drivers/serial/mpc52xx_uart.c
> @@ -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
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-20  7:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-20  0:28 [PATCH] powerpc/5200: beyond ARRAY_SIZE of mpc52xx_uart_{ports, nodes} Roel Kluin
2009-05-20  7:11 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).