提交 165bce97 编写于 作者: D Dan Carpenter 提交者: Samuel Ortiz

mfd: Proper pcf50633 irq check

"pcf->irq_handler" has PCF50633_NUM_IRQ elements.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 2a0cb351
...@@ -218,7 +218,7 @@ static struct attribute_group pcf_attr_group = { ...@@ -218,7 +218,7 @@ static struct attribute_group pcf_attr_group = {
int pcf50633_register_irq(struct pcf50633 *pcf, int irq, int pcf50633_register_irq(struct pcf50633 *pcf, int irq,
void (*handler) (int, void *), void *data) void (*handler) (int, void *), void *data)
{ {
if (irq < 0 || irq > PCF50633_NUM_IRQ || !handler) if (irq < 0 || irq >= PCF50633_NUM_IRQ || !handler)
return -EINVAL; return -EINVAL;
if (WARN_ON(pcf->irq_handler[irq].handler)) if (WARN_ON(pcf->irq_handler[irq].handler))
...@@ -235,7 +235,7 @@ EXPORT_SYMBOL_GPL(pcf50633_register_irq); ...@@ -235,7 +235,7 @@ EXPORT_SYMBOL_GPL(pcf50633_register_irq);
int pcf50633_free_irq(struct pcf50633 *pcf, int 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; return -EINVAL;
mutex_lock(&pcf->lock); mutex_lock(&pcf->lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册