Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756655Ab0DBJyn (ORCPT ); Fri, 2 Apr 2010 05:54:43 -0400 Received: from mga06.intel.com ([134.134.136.21]:51324 "EHLO orsmga101.jf.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753484Ab0DBJyf (ORCPT ); Fri, 2 Apr 2010 05:54:35 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.51,352,1267430400"; d="scan'208";a="505804406" Date: Fri, 2 Apr 2010 11:55:12 +0200 From: Samuel Ortiz To: Dan Carpenter , Paul Fertser , Lars-Peter Clausen , Mark Brown , Arnaud Patard , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [patch] mfd: off by one issue Message-ID: <20100402095511.GA8010@sortiz.org> References: <20100328112808.GO5069@bicker> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100328112808.GO5069@bicker> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1348 Lines: 43 Hi Dan, On Sun, Mar 28, 2010 at 02:28:08PM +0300, Dan Carpenter wrote: > "pcf->irq_handler" has PCF50633_NUM_IRQ elements. > > Signed-off-by: Dan Carpenter Patch applied, many thanks. Cheers, Samuel. > diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c > index 03dcc92..4f13608 100644 > --- a/drivers/mfd/pcf50633-core.c > +++ b/drivers/mfd/pcf50633-core.c > @@ -217,7 +217,7 @@ static struct attribute_group pcf_attr_group = { > int pcf50633_register_irq(struct pcf50633 *pcf, int irq, > void (*handler) (int, void *), void *data) > { > - if (irq < 0 || irq > PCF50633_NUM_IRQ || !handler) > + if (irq < 0 || irq >= PCF50633_NUM_IRQ || !handler) > return -EINVAL; > > if (WARN_ON(pcf->irq_handler[irq].handler)) > @@ -234,7 +234,7 @@ EXPORT_SYMBOL_GPL(pcf50633_register_irq); > > int pcf50633_free_irq(struct pcf50633 *pcf, int irq) > { > - if (irq < 0 || irq > PCF50633_NUM_IRQ) > + if (irq < 0 || irq >= PCF50633_NUM_IRQ) > return -EINVAL; > > mutex_lock(&pcf->lock); -- Intel Open Source Technology Centre http://oss.intel.com/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/