Skip to content

Commit

Permalink
dmaengine: ste_dma40: Add missing IRQ check in d40_probe
Browse files Browse the repository at this point in the history
[ Upstream commit c05ce69 ]

Check for the return value of platform_get_irq(): if no interrupt
is specified, it wouldn't make sense to call request_irq().

Fixes: 8d318a5 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
ruanjinjie authored and gregkh committed Sep 13, 2023
1 parent 43a57ca commit e351933
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/dma/ste_dma40.c
Expand Up @@ -3597,6 +3597,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) {
Expand Down

0 comments on commit e351933

Please sign in to comment.