diff options
author | Qiushi Wu <wu000273@umn.edu> | 2020-06-13 22:44:19 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-06-17 15:04:02 +0200 |
commit | deca195383a6085be62cb453079e03e04d618d6e (patch) | |
tree | 53ff154c1c3aa4d02f8f43429439abc7b9c8bc32 /sound/soc/tegra/tegra30_ahub.c | |
parent | ASoC: rt1015: Flush DAC data before playback. (diff) | |
download | linux-deca195383a6085be62cb453079e03e04d618d6e.tar.xz linux-deca195383a6085be62cb453079e03e04d618d6e.zip |
ASoC: tegra: Fix reference count leaks.
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.
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20200613204422.24484-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/tegra/tegra30_ahub.c')
-rw-r--r-- | sound/soc/tegra/tegra30_ahub.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c index 635eacbd28d4..156e3b9d613c 100644 --- a/sound/soc/tegra/tegra30_ahub.c +++ b/sound/soc/tegra/tegra30_ahub.c @@ -643,8 +643,10 @@ static int tegra30_ahub_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(ahub->regmap_ahub); ret |= regcache_sync(ahub->regmap_apbif); pm_runtime_put(dev); |