X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fmfd%2Fpcf50633-core.c;fp=drivers%2Fmfd%2Fpcf50633-core.c;h=5439282804cc58890cd729398e252af45a572268;hb=165bce9783ab307368e56b7c1a168520a3791266;hp=710e417e0eeceae30e62d62ba9e3ce11fb6bbf9e;hpb=2a0cb351001bebf195d3c43d0f70441eb6a62652;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 710e417..5439282 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);