public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] off by one bug
@ 2010-01-03 12:08 Dan Carpenter
  2010-01-03 20:58 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2010-01-03 12:08 UTC (permalink / raw)
  To: Mark Brown; +Cc: Samuel Ortiz, linux-kernel

If irq == WM8350_NUM_IRQ that would put us past the end of the array.

Signed-off-by: Dan Carpenter <error27@gmail.com>

--- orig/drivers/mfd/wm8350-irq.c	2010-01-03 14:02:43.000000000 +0200
+++ devel/drivers/mfd/wm8350-irq.c	2010-01-03 14:04:18.000000000 +0200
@@ -434,7 +434,7 @@ int wm8350_register_irq(struct wm8350 *w
 			irq_handler_t handler, unsigned long flags,
 			const char *name, void *data)
 {
-	if (irq < 0 || irq > WM8350_NUM_IRQ || !handler)
+	if (irq < 0 || irq >= WM8350_NUM_IRQ || !handler)
 		return -EINVAL;
 
 	if (wm8350->irq[irq].handler)
@@ -453,7 +453,7 @@ EXPORT_SYMBOL_GPL(wm8350_register_irq);
 
 int wm8350_free_irq(struct wm8350 *wm8350, int irq)
 {
-	if (irq < 0 || irq > WM8350_NUM_IRQ)
+	if (irq < 0 || irq >= WM8350_NUM_IRQ)
 		return -EINVAL;
 
 	wm8350_mask_irq(wm8350, irq);

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

* [patch] off by one bug
@ 2010-01-03 12:14 Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2010-01-03 12:14 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel

if irq == PCF50633_NUM_IRQ that puts us past the end of the array.

Signed-off-by: Dan Carpenter <error27@gmail.com>

--- orig/drivers/mfd/pcf50633-core.c	2010-01-03 14:10:10.000000000 +0200
+++ devel/drivers/mfd/pcf50633-core.c	2010-01-03 14:10:31.000000000 +0200
@@ -217,7 +217,7 @@ static struct attribute_group pcf_attr_g
 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);

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

* Re: [patch] off by one bug
  2010-01-03 12:08 [patch] off by one bug Dan Carpenter
@ 2010-01-03 20:58 ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2010-01-03 20:58 UTC (permalink / raw)
  To: Dan Carpenter, Samuel Ortiz, linux-kernel

On Sun, Jan 03, 2010 at 02:08:17PM +0200, Dan Carpenter wrote:
> If irq == WM8350_NUM_IRQ that would put us past the end of the array.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

but please take a look at the advice in Documentation/SubmittingPatches
about picking a title for your patch, with the one you've got it's not
even clear which subsystem you're talking about never mind which driver.

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

end of thread, other threads:[~2010-01-03 20:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-03 12:08 [patch] off by one bug Dan Carpenter
2010-01-03 20:58 ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2010-01-03 12:14 Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox