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

ruanjinjie ruanjinjie at huawei.com
Tue Nov 15 22:57:17 PST 2022


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 at 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(-)

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




More information about the linux-arm-kernel mailing list