From patchwork Wed May 20 00:28:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 27436 X-Patchwork-Delegate: grant.likely@secretlab.ca Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id E92BDB7079 for ; Wed, 20 May 2009 10:29:18 +1000 (EST) Received: by ozlabs.org (Postfix) id 9F3F3DE3A4; Wed, 20 May 2009 10:29:10 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 9CFACDE3A3 for ; Wed, 20 May 2009 10:29:10 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=xh/h7Z+hee00T+ycJgpeZ2Syr4i1WR0V7PXo9rrMdOE=; b=XUUz3g6Fazw5d1Y97CdPst7s/tZXccfgEoSYoPJQZKL/FgQ4zQx9Geg5y2PVZ9XKip hDSsd0cz6F7CN5WFeZPHX5VAV8o+2Px494yPnUxxzSlBe5dSYLh+S/obvfbDAfj30ECB HQMjAope9Ezafj7peUwm/9dOa2PlZ4doWUQTA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=XsIYVxuYMjNdQBBz/37d8Xm7YLruqLRtnoG+l1A6S+gVFnPn1gAbBZHsgUXP7ixXpg 6IPnX615VDAUnEQS2g3MoeguSRdvqMQ/QWGMR+RqaP9i4KJxCOpscWYjn/y3rrHjEuQo 5TFrlSTbI7Qt+OdYPBHKasmdq9tN2+LpBadq8= Received: by 10.210.116.14 with SMTP id o14mr908257ebc.32.1242779332411; Tue, 19 May 2009 17:28:52 -0700 (PDT) Received: from ?192.168.1.2? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 24sm535651eyx.23.2009.05.19.17.28.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 19 May 2009 17:28:51 -0700 (PDT) Message-ID: <4A134EC4.3000805@gmail.com> Date: Wed, 20 May 2009 02:28:52 +0200 From: Roel Kluin User-Agent: Thunderbird 2.0.0.21 (X11/20090302) MIME-Version: 1.0 To: grant.likely@secretlab.ca Subject: [PATCH] powerpc/5200: beyond ARRAY_SIZE of mpc52xx_uart_{ports, nodes} Cc: linuxppc-dev@ozlabs.org, Andrew Morton X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Do not go beyond ARRAY_SIZE of mpc52xx_uart_{ports,nodes} Signed-off-by: Roel Kluin Acked-by: Wolfram Sang 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; }