From: Zhen Ni <nizhen@uniontech.com>
To: frattaroli.nicolas@gmail.com, lgirdwood@gmail.com,
broonie@kernel.org, tiwai@suse.com
Cc: Zhen Ni <nizhen@uniontech.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ASoC: rockchip: i2s_tdm: fix runtime pm imbalance on error
Date: Wed, 2 Mar 2022 18:00:19 +0800 [thread overview]
Message-ID: <20220302100019.22891-1-nizhen@uniontech.com> (raw)
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: Zhen Ni <nizhen@uniontech.com>
---
sound/soc/rockchip/rockchip_i2s_tdm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c
index 5f9cb5c4c7f0..4691a76b499d 100644
--- a/sound/soc/rockchip/rockchip_i2s_tdm.c
+++ b/sound/soc/rockchip/rockchip_i2s_tdm.c
@@ -1739,8 +1739,10 @@ static int __maybe_unused rockchip_i2s_tdm_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(i2s_tdm->regmap);
pm_runtime_put(dev);
--
2.20.1
next reply other threads:[~2022-03-02 10:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 10:00 Zhen Ni [this message]
2022-03-02 10:04 ` [PATCH] ASoC: rockchip: i2s_tdm: fix runtime pm imbalance on error Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220302100019.22891-1-nizhen@uniontech.com \
--to=nizhen@uniontech.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=frattaroli.nicolas@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox