Skip to content

Commit f141a42

Browse files
QiushiWubroonie
authored andcommitted
ASoC: rockchip: Fix a reference count leak.
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count if pm_runtime_put is not called in error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails. Fixes: fc05a5b ("ASoC: rockchip: add support for pdm controller") Signed-off-by: Qiushi Wu <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 9f7041b commit f141a42

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/soc/rockchip/rockchip_pdm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,10 @@ static int rockchip_pdm_resume(struct device *dev)
590590
int ret;
591591

592592
ret = pm_runtime_get_sync(dev);
593-
if (ret < 0)
593+
if (ret < 0) {
594+
pm_runtime_put(dev);
594595
return ret;
596+
}
595597

596598
ret = regcache_sync(pdm->regmap);
597599

0 commit comments

Comments
 (0)