2023-07-24 06:58:37

by Jinjie Ruan

[permalink] [raw]
Subject: [PATCH -next] dmaengine: ste_dma40: Add missing IRQ check in d40_probe

From: ruanjinjie <[email protected]>

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 <[email protected]>
---
drivers/dma/ste_dma40.c | 4 ++++
1 file changed, 4 insertions(+)

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) {
--
2.34.1



2023-08-04 01:35:13

by Jinjie Ruan

[permalink] [raw]
Subject: Re: [PATCH -next] dmaengine: ste_dma40: Add missing IRQ check in d40_probe

Ping.

On 2023/7/24 22:41, Ruan Jinjie wrote:
> From: ruanjinjie <[email protected]>
>
> 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 <[email protected]>
> ---
> drivers/dma/ste_dma40.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> 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) {

2023-08-10 09:53:24

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH -next] dmaengine: ste_dma40: Add missing IRQ check in d40_probe

On Mon, Jul 24, 2023 at 8:40 AM Ruan Jinjie <[email protected]> wrote:

> From: ruanjinjie <[email protected]>
>
> 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 <[email protected]>

Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij