diff options
author | Dan Carpenter <error27@gmail.com> | 2010-03-28 07:28:08 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-05-27 19:37:32 -0400 |
commit | 165bce9783ab307368e56b7c1a168520a3791266 (patch) | |
tree | f199c3c7177606814b968bd45bfa751ef72bce51 /drivers | |
parent | 2a0cb351001bebf195d3c43d0f70441eb6a62652 (diff) |
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 = { | |||
218 | int pcf50633_register_irq(struct pcf50633 *pcf, int irq, | 218 | int pcf50633_register_irq(struct pcf50633 *pcf, int irq, |
219 | void (*handler) (int, void *), void *data) | 219 | void (*handler) (int, void *), void *data) |
220 | { | 220 | { |
221 | if (irq < 0 || irq > PCF50633_NUM_IRQ || !handler) | 221 | if (irq < 0 || irq >= PCF50633_NUM_IRQ || !handler) |
222 | return -EINVAL; | 222 | return -EINVAL; |
223 | 223 | ||
224 | if (WARN_ON(pcf->irq_handler[irq].handler)) | 224 | if (WARN_ON(pcf->irq_handler[irq].handler)) |
@@ -235,7 +235,7 @@ EXPORT_SYMBOL_GPL(pcf50633_register_irq); | |||
235 | 235 | ||
236 | int pcf50633_free_irq(struct pcf50633 *pcf, int irq) | 236 | int pcf50633_free_irq(struct pcf50633 *pcf, int irq) |
237 | { | 237 | { |
238 | if (irq < 0 || irq > PCF50633_NUM_IRQ) | 238 | if (irq < 0 || irq >= PCF50633_NUM_IRQ) |
239 | return -EINVAL; | 239 | return -EINVAL; |
240 | 240 | ||
241 | mutex_lock(&pcf->lock); | 241 | mutex_lock(&pcf->lock); |