* [patch] mfd: off by one issue
@ 2010-03-28 11:28 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-03-28 11:28 UTC (permalink / raw)
To: Samuel Ortiz
Cc: Paul Fertser, Lars-Peter Clausen, Mark Brown, Arnaud Patard,
linux-kernel, kernel-janitors
"pcf->irq_handler" has PCF50633_NUM_IRQ elements.
Signed-off-by: Dan Carpenter <error27@gmail.com>
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);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-03-28 11:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-28 11:28 [patch] mfd: off by one issue Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox