"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>
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))
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);