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