未验证 提交 f141a422 编写于 作者: Q Qiushi Wu 提交者: Mark Brown

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: fc05a5b2 ("ASoC: rockchip: add support for pdm controller")
Signed-off-by: NQiushi Wu <wu000273@umn.edu>
Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20200613205158.27296-1-wu000273@umn.eduSigned-off-by: NMark Brown <broonie@kernel.org>
上级 9f7041b7
......@@ -590,8 +590,10 @@ static int rockchip_pdm_resume(struct device *dev)
int ret;
ret = pm_runtime_get_sync(dev);
if (ret < 0)
if (ret < 0) {
pm_runtime_put(dev);
return ret;
}
ret = regcache_sync(pdm->regmap);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册