diff options
author | Dan Carpenter <error27@gmail.com> | 2010-03-28 14:28:08 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-05-28 01:37:32 +0200 |
commit | 165bce9783ab307368e56b7c1a168520a3791266 (patch) | |
tree | f199c3c7177606814b968bd45bfa751ef72bce51 /drivers | |
parent | 2a0cb351001bebf195d3c43d0f70441eb6a62652 (diff) | |
download | linux-stable-165bce9783ab307368e56b7c1a168520a3791266.tar.gz linux-stable-165bce9783ab307368e56b7c1a168520a3791266.tar.bz2 linux-stable-165bce9783ab307368e56b7c1a168520a3791266.zip |
mfd: Proper pcf50633 irq check
"pcf->irq_handler" has PCF50633_NUM_IRQ elements.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mfd/pcf50633-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 710e417e0eec..5439282804cc 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c @@ -218,7 +218,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)) @@ -235,7 +235,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); |