summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2020-05-29 09:22:28 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-01 13:14:47 +0200
commitfce356afe09a4f62ebcd7080c924828aac841b75 (patch)
tree5f07e1de47ba9c6288966c5c815c24b73a03b40e
parenta63689c06a6dd5c0cf2a9221927b9b1b2b2bb9c1 (diff)
downloadlinux-stable-fce356afe09a4f62ebcd7080c924828aac841b75.tar.gz
linux-stable-fce356afe09a4f62ebcd7080c924828aac841b75.tar.bz2
linux-stable-fce356afe09a4f62ebcd7080c924828aac841b75.zip
ASoC: img-i2s-out: Fix runtime PM imbalance on error
[ Upstream commit 65bd91dd6957390c42a0491b9622cf31a2cdb140 ] pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Link: https://lore.kernel.org/r/20200529012230.5863-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--sound/soc/img/img-i2s-out.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/img/img-i2s-out.c b/sound/soc/img/img-i2s-out.c
index fc2d1dac6333..798ab579564c 100644
--- a/sound/soc/img/img-i2s-out.c
+++ b/sound/soc/img/img-i2s-out.c
@@ -350,8 +350,10 @@ static int img_i2s_out_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
chan_control_mask = IMG_I2S_OUT_CHAN_CTL_CLKT_MASK;
ret = pm_runtime_get_sync(i2s->dev);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put_noidle(i2s->dev);
return ret;
+ }
img_i2s_out_disable(i2s);
@@ -491,8 +493,10 @@ static int img_i2s_out_probe(struct platform_device *pdev)
goto err_pm_disable;
}
ret = pm_runtime_get_sync(&pdev->dev);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put_noidle(&pdev->dev);
goto err_suspend;
+ }
reg = IMG_I2S_OUT_CTL_FRM_SIZE_MASK;
img_i2s_out_writel(i2s, reg, IMG_I2S_OUT_CTL);