Skip to content

Commit 1e42f82

Browse files
Uwe Kleine-Königvinodkoul
authored andcommitted
dmaengine: sprd: Cleanup in .remove() after pm_runtime_get_sync() failed
It's not allowed to quit remove early without cleaning up completely. Otherwise this results in resource leaks that probably yield graver problems later. Here for example some tasklets might survive the lifetime of the sprd-dma device and access sdev which is freed after .remove() returns. As none of the device freeing requires an active device, just ignore the return value of pm_runtime_get_sync(). Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Baolin Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 36834c6 commit 1e42f82

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/dma/sprd-dma.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,11 +1237,8 @@ static int sprd_dma_remove(struct platform_device *pdev)
12371237
{
12381238
struct sprd_dma_dev *sdev = platform_get_drvdata(pdev);
12391239
struct sprd_dma_chn *c, *cn;
1240-
int ret;
12411240

1242-
ret = pm_runtime_get_sync(&pdev->dev);
1243-
if (ret < 0)
1244-
return ret;
1241+
pm_runtime_get_sync(&pdev->dev);
12451242

12461243
/* explicitly free the irq */
12471244
if (sdev->irq > 0)

0 commit comments

Comments
 (0)