From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ew0-f167.google.com (mail-ew0-f167.google.com [209.85.219.167]) by ozlabs.org (Postfix) with ESMTP id 0A1F8DE11F for ; Wed, 20 May 2009 10:28:54 +1000 (EST) Received: by ewy11 with SMTP id 11so177393ewy.9 for ; Tue, 19 May 2009 17:28:52 -0700 (PDT) Message-ID: <4A134EC4.3000805@gmail.com> Date: Wed, 20 May 2009 02:28:52 +0200 From: Roel Kluin MIME-Version: 1.0 To: grant.likely@secretlab.ca Subject: [PATCH] powerpc/5200: beyond ARRAY_SIZE of mpc52xx_uart_{ports, nodes} Content-Type: text/plain; charset=ISO-8859-1 Cc: linuxppc-dev@ozlabs.org, Andrew Morton List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Do not go beyond ARRAY_SIZE of mpc52xx_uart_{ports,nodes} Signed-off-by: Roel Kluin --- 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; }