greybus: gpio: fix null-deref on unexpected irq requests
Fix null-pointer dereference on failure to look up irq due to missing error handling. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
parent
1842dd8b7b
commit
244b5a2344
@ -425,7 +425,15 @@ static void gb_gpio_request_recv(u8 type, struct gb_operation *op)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
irq = gpio_to_irq(ggc->chip.base + event->which);
|
irq = gpio_to_irq(ggc->chip.base + event->which);
|
||||||
|
if (irq < 0) {
|
||||||
|
dev_err(ggc->chip.dev, "failed to map irq\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
desc = irq_to_desc(irq);
|
desc = irq_to_desc(irq);
|
||||||
|
if (!desc) {
|
||||||
|
dev_err(ggc->chip.dev, "failed to look up irq\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Dispatch interrupt */
|
/* Dispatch interrupt */
|
||||||
local_irq_disable();
|
local_irq_disable();
|
||||||
|
Loading…
Reference in New Issue
Block a user