Skip to content

Commit 8982d48

Browse files
YuKuai-huaweivinodkoul
authored andcommitted
dmaengine: zynqmp_dma: Fix PM reference leak in zynqmp_dma_alloc_chan_resourc()
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 538ea65 commit 8982d48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/xilinx/zynqmp_dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
468468
struct zynqmp_dma_desc_sw *desc;
469469
int i, ret;
470470

471-
ret = pm_runtime_get_sync(chan->dev);
471+
ret = pm_runtime_resume_and_get(chan->dev);
472472
if (ret < 0)
473473
return ret;
474474

0 commit comments

Comments
 (0)