[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100103120817.GA19360@bicker>
Date: Sun, 3 Jan 2010 14:08:17 +0200
From: Dan Carpenter <error27@...il.com>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc: Samuel Ortiz <sameo@...ux.intel.com>, linux-kernel@...r.kernel.org
Subject: [patch] off by one bug
If irq == WM8350_NUM_IRQ that would put us past the end of the array.
Signed-off-by: Dan Carpenter <error27@...il.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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists