Skip to content

Commit d887d61

Browse files
tititiou36gregkh
authored andcommitted
staging: mt7621-dma: Fix a resource leak in an error handling path
If an error occurs after calling 'mtk_hsdma_init()', it must be undone by a corresponding call to 'mtk_hsdma_uninit()' as already done in the remove function. Fixes: 0853c7a ("staging: mt7621-dma: ralink: add rt2880 dma engine") Signed-off-by: Christophe JAILLET <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent cab36da commit d887d61

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/staging/mt7621-dma/mtk-hsdma.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
712712
ret = dma_async_device_register(dd);
713713
if (ret) {
714714
dev_err(&pdev->dev, "failed to register dma device\n");
715-
return ret;
715+
goto err_uninit_hsdma;
716716
}
717717

718718
ret = of_dma_controller_register(pdev->dev.of_node,
@@ -728,6 +728,8 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
728728

729729
err_unregister:
730730
dma_async_device_unregister(dd);
731+
err_uninit_hsdma:
732+
mtk_hsdma_uninit(hsdma);
731733
return ret;
732734
}
733735

0 commit comments

Comments
 (0)