lkml.org 
[lkml]   [2010]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] off by one bug
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);

\
 
 \ /
  Last update: 2010-01-03 13:19    [W:0.057 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site