Skip to content

Commit 6b9fbb0

Browse files
QiushiWubroonie
authored andcommitted
ASoC: img-parallel-out: Fix a reference count leak
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code, causing incorrect ref count if pm_runtime_put_noidle() is not called in error handling paths. Thus call pm_runtime_put_noidle() if pm_runtime_get_sync() fails. Signed-off-by: Qiushi Wu <wu000273@umn.edu> Link: https://lore.kernel.org/r/20200614033344.1814-1-wu000273@umn.edu Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent c4c59b9 commit 6b9fbb0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/soc/img/img-parallel-out.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@ static int img_prl_out_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
163163
}
164164

165165
ret = pm_runtime_get_sync(prl->dev);
166-
if (ret < 0)
166+
if (ret < 0) {
167+
pm_runtime_put_noidle(prl->dev);
167168
return ret;
169+
}
168170

169171
reg = img_prl_out_readl(prl, IMG_PRL_OUT_CTL);
170172
reg = (reg & ~IMG_PRL_OUT_CTL_EDGE_MASK) | control_set;

0 commit comments

Comments
 (0)