diff mbox series

[v2] dmaengine: ste_dma40: use devm_request_irq to avoid missing free_irq() in error path

Message ID 20221116065717.3069712-1-ruanjinjie@huawei.com (mailing list archive)
State New, archived
Headers show
Series [v2] dmaengine: ste_dma40: use devm_request_irq to avoid missing free_irq() in error path | expand

Commit Message

Jinjie Ruan Nov. 16, 2022, 6:57 a.m. UTC
free_irq() is missing in some cases of error in d40_probe(), use
devm_request_irq to fix that.

Fixes: d7b7ecce4bcb ("ste_dma40: Rename a jump label in d40_probe()")
Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
---
v2:
- use devm_request_irq instead of adding free_irq() to fix the problem.
---
 drivers/dma/ste_dma40.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Nov. 17, 2022, 9:07 a.m. UTC | #1
On Wed, Nov 16, 2022 at 8:01 AM ruanjinjie <ruanjinjie@huawei.com> wrote:

> free_irq() is missing in some cases of error in d40_probe(), use
> devm_request_irq to fix that.
>
> Fixes: d7b7ecce4bcb ("ste_dma40: Rename a jump label in d40_probe()")
> Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
> ---
> v2:
> - use devm_request_irq instead of adding free_irq() to fix the problem.

Thanks!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index f093e08c23b1..3214d2cb027e 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3598,7 +3598,7 @@  static int __init d40_probe(struct platform_device *pdev)
 
 	base->irq = platform_get_irq(pdev, 0);
 
-	ret = request_irq(base->irq, d40_handle_interrupt, 0, D40_NAME, base);
+	ret = devm_request_irq(&pdev->dev, base->irq, d40_handle_interrupt, 0, D40_NAME, base);
 	if (ret) {
 		d40_err(&pdev->dev, "No IRQ defined\n");
 		goto destroy_cache;