From patchwork Thu Apr 22 09:40:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 94069 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3MATISu020309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 22 Apr 2010 10:29:56 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1O4tdC-0005hh-Hz; Thu, 22 Apr 2010 10:27:38 +0000 Received: from sfi-mx-4.v28.ch3.sourceforge.com ([172.29.28.124] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1O4suH-0002Yj-Ux for dri-devel@lists.sourceforge.net; Thu, 22 Apr 2010 09:41:13 +0000 Received-SPF: pass (sfi-mx-4.v28.ch3.sourceforge.com: domain of gmail.com designates 74.125.82.175 as permitted sender) client-ip=74.125.82.175; envelope-from=error27@gmail.com; helo=mail-wy0-f175.google.com; Received: from mail-wy0-f175.google.com ([74.125.82.175]) by sfi-mx-4.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1O4suF-0000vF-HQ for dri-devel@lists.sourceforge.net; Thu, 22 Apr 2010 09:41:13 +0000 Received: by wyb29 with SMTP id 29so1364810wyb.34 for ; Thu, 22 Apr 2010 02:41:05 -0700 (PDT) Received: by 10.216.87.68 with SMTP id x46mr2274146wee.145.1271929265530; Thu, 22 Apr 2010 02:41:05 -0700 (PDT) Received: from bicker ([41.222.20.196]) by mx.google.com with ESMTPS id x1sm74327553wbx.13.2010.04.22.02.41.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 22 Apr 2010 02:41:04 -0700 (PDT) Date: Thu, 22 Apr 2010 11:40:53 +0200 From: Dan Carpenter To: David Airlie Subject: [patch] nouveau: off by one in nv50_gpio_location() Message-ID: <20100422094053.GL29647@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Score: -0.8 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.0 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.8 AWL AWL: From: address is in the auto white-list X-Headers-End: 1O4suF-0000vF-HQ X-Mailman-Approved-At: Thu, 22 Apr 2010 10:27:37 +0000 Cc: dri-devel@lists.sourceforge.net, kernel-janitors@vger.kernel.org, Ben Skeggs X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 22 Apr 2010 10:30:19 +0000 (UTC) diff --git a/drivers/gpu/drm/nouveau/nv50_gpio.c b/drivers/gpu/drm/nouveau/nv50_gpio.c index c61782b..bb47ad7 100644 --- a/drivers/gpu/drm/nouveau/nv50_gpio.c +++ b/drivers/gpu/drm/nouveau/nv50_gpio.c @@ -31,7 +31,7 @@ nv50_gpio_location(struct dcb_gpio_entry *gpio, uint32_t *reg, uint32_t *shift) { const uint32_t nv50_gpio_reg[4] = { 0xe104, 0xe108, 0xe280, 0xe284 }; - if (gpio->line > 32) + if (gpio->line >= 32) return -EINVAL; *reg = nv50_gpio_reg[gpio->line >> 3];