[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220128162659.14227-1-linmq006@gmail.com>
Date: Fri, 28 Jan 2022 16:26:59 +0000
From: Miaoqian Lin <linmq006@...il.com>
To: Vinod Koul <vkoul@...nel.org>,
Zhangfei Gao <zhangfei.gao@...aro.org>,
Arnd Bergmann <arnd@...db.de>, dmaengine@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: linmq006@...il.com
Subject: [PATCH] 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")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
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
Powered by blists - more mailing lists