linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] dmaengine: ste_dma40: Add missing IRQ check in d40_probe
@ 2023-07-24 14:41 Ruan Jinjie
  2023-08-04  1:13 ` Ruan Jinjie
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ruan Jinjie @ 2023-07-24 14:41 UTC (permalink / raw)
  To: linus.walleij, vkoul, akpm, dan.j.williams, srinidhi.kasagar,
	linux-arm-kernel, dmaengine, linux-kernel
  Cc: ruanjinjie

From: ruanjinjie <ruanjinjie@huawei.com>

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>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] dmaengine: ste_dma40: Add missing IRQ check in d40_probe
  2023-07-24 14:41 [PATCH -next] dmaengine: ste_dma40: Add missing IRQ check in d40_probe Ruan Jinjie
@ 2023-08-04  1:13 ` Ruan Jinjie
  2023-08-10  8:20 ` Linus Walleij
  2023-08-21 13:51 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Ruan Jinjie @ 2023-08-04  1:13 UTC (permalink / raw)
  To: linus.walleij, vkoul, akpm, dan.j.williams, srinidhi.kasagar,
	linux-arm-kernel, dmaengine, linux-kernel

Ping.

On 2023/7/24 22:41, Ruan Jinjie wrote:
> From: ruanjinjie <ruanjinjie@huawei.com>
> 
> 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>
> ---
>  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) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] dmaengine: ste_dma40: Add missing IRQ check in d40_probe
  2023-07-24 14:41 [PATCH -next] dmaengine: ste_dma40: Add missing IRQ check in d40_probe Ruan Jinjie
  2023-08-04  1:13 ` Ruan Jinjie
@ 2023-08-10  8:20 ` Linus Walleij
  2023-08-21 13:51 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2023-08-10  8:20 UTC (permalink / raw)
  To: Ruan Jinjie
  Cc: vkoul, akpm, dan.j.williams, srinidhi.kasagar, linux-arm-kernel,
	dmaengine, linux-kernel

On Mon, Jul 24, 2023 at 8:40 AM Ruan Jinjie <ruanjinjie@huawei.com> wrote:

> From: ruanjinjie <ruanjinjie@huawei.com>
>
> 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>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] dmaengine: ste_dma40: Add missing IRQ check in d40_probe
  2023-07-24 14:41 [PATCH -next] dmaengine: ste_dma40: Add missing IRQ check in d40_probe Ruan Jinjie
  2023-08-04  1:13 ` Ruan Jinjie
  2023-08-10  8:20 ` Linus Walleij
@ 2023-08-21 13:51 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2023-08-21 13:51 UTC (permalink / raw)
  To: linus.walleij, akpm, dan.j.williams, srinidhi.kasagar,
	linux-arm-kernel, dmaengine, linux-kernel, Ruan Jinjie


On Mon, 24 Jul 2023 14:41:08 +0000, Ruan Jinjie wrote:
> Check for the return value of platform_get_irq(): if no interrupt
> is specified, it wouldn't make sense to call request_irq().
> 
> 

Applied, thanks!

[1/1] dmaengine: ste_dma40: Add missing IRQ check in d40_probe
      commit: c05ce6907b3d6e148b70f0bb5eafd61dcef1ddc1

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-21 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-24 14:41 [PATCH -next] dmaengine: ste_dma40: Add missing IRQ check in d40_probe Ruan Jinjie
2023-08-04  1:13 ` Ruan Jinjie
2023-08-10  8:20 ` Linus Walleij
2023-08-21 13:51 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).