Skip to contentSkip to conversation

dmaengine: zx: add check on platform_get_irq return value

PATCH New Gustavo A. R. Silva 1 participant 1 message Jun 30, 2017 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: zx: add check on platform_get_irq return value

Check return value from call to platform_get_irq(), so in case of failure print error message and propagate the return value.

---
 drivers/dma/zx_dma.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/dma/zx_dma.c +5 -0
index 2bb6953..26196de 100644
@@ -786,6 +786,11 @@ static int zx_dma_probe(struct platform_device *op)
 	}
 
 	d->irq = platform_get_irq(op, 0);
+	if (d->irq < 0) {
+		dev_err(&op->dev, "failed to get IRQ: %d\n", d->irq);
+		return d->irq;
+	}
+
 	ret = devm_request_irq(&op->dev, d->irq, zx_dma_int_handler,
 			       0, DRIVER_NAME, d);
 	if (ret)
Signature · 1 line
2.5.0