[PATCH] dmaengine: k3dma: Add missing IRQ check in k3_dma_probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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")
Signed-off-by: Miaoqian Lin <linmq006@xxxxxxxxx>
---
 drivers/dma/k3dma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index ecdaada95120..3c2c44efc8f6 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -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)
-- 
2.17.1




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux