1
0
Fork 0

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: fc05a5b222 ("ASoC: rockchip: add support for pdm controller")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20200613205158.27296-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
alistair/sunxi64-5.8
Qiushi Wu 2020-06-13 15:51:58 -05:00 committed by Mark Brown
parent 9f7041b71a
commit f141a42215
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 3 additions and 1 deletions

View File

@ -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);