Skip to contentSkip to conversation

dmaengine: k3dma: Add missing IRQ check in k3_dma_probe

PATCH New Miaoqian Lin 1 participant 1 message Jan 28, 2022 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: k3dma: Add missing IRQ check in k3_dma_probe

This check misses checking for platform_get_irq()'s call and may passes the negative error codes to devm_request_irq(), which takes unsigned IRQ #, causing it to fail with -EINVAL, overriding an original error code. Stop calling devm_request_irq() with invalid IRQ #s.

Fixes 8e6152bc660e ("dmaengine: Add hisilicon k3 DMA engine driver")
---
 drivers/dma/k3dma.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/dma/k3dma.c +2 -0
index ecdaada95120..3c2c44efc8f6 100644
@@ -878,6 +878,8 @@ static int k3_dma_probe(struct platform_device *op)
 	}
 
 	irq = platform_get_irq(op, 0);
+	if (irq < 0)
+		return irq;
 	ret = devm_request_irq(&op->dev, irq,
 			k3_dma_int_handler, 0, DRIVER_NAME, d);
 	if (ret)
Signature · 1 line
2.17.1