summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorruanjinjie <ruanjinjie@huawei.com>2023-07-24 16:41:08 +0200
committerVinod Koul <vkoul@kernel.org>2023-08-21 07:42:16 +0200
commitc05ce6907b3d6e148b70f0bb5eafd61dcef1ddc1 (patch)
tree24e55068b210a6e5dbff76ddec47eead6094e589
parentdmaengine: owl-dma: fix clang -Wvoid-pointer-to-enum-cast warning (diff)
downloadlinux-c05ce6907b3d6e148b70f0bb5eafd61dcef1ddc1.tar.xz
linux-c05ce6907b3d6e148b70f0bb5eafd61dcef1ddc1.zip
dmaengine: ste_dma40: Add missing IRQ check in d40_probe
Check for the return value of platform_get_irq(): if no interrupt is specified, it wouldn't make sense to call request_irq(). Fixes: 8d318a50b3d7 ("DMAENGINE: Support for ST-Ericssons DMA40 block v3") Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230724144108.2582917-1-ruanjinjie@huawei.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/dma/ste_dma40.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 825001bde42c..89e82508c133 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3590,6 +3590,10 @@ static int __init d40_probe(struct platform_device *pdev)
spin_lock_init(&base->lcla_pool.lock);
base->irq = platform_get_irq(pdev, 0);
+ if (base->irq < 0) {
+ ret = base->irq;
+ goto destroy_cache;
+ }
ret = request_irq(base->irq, d40_handle_interrupt, 0, D40_NAME, base);
if (ret) {