From: Bixuan Cui <cuibixuan@huawei.com>
To: <linux-kernel@vger.kernel.org>
Cc: <john.wanghui@huawei.com>, <eric@anholt.net>,
<mripard@kernel.org>, <airlied@linux.ie>, <daniel@ffwll.ch>,
<dri-devel@lists.freedesktop.org>,
Bixuan Cui <cuibixuan@huawei.com>
Subject: [PATCH] drm/vc4: Fix PM reference leak in vc4_vec_encoder_enable()
Date: Fri, 9 Apr 2021 08:38:55 +0800 [thread overview]
Message-ID: <20210409003855.56606-1-cuibixuan@huawei.com> (raw)
The pm_runtime_get_sync will increment pm usage counter even it failed.Thus a
pairing decrement is needed.
Change pm_runtime_get_sync to pm_runtime_resume_and_get for keeping usage counter
balanced.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
---
drivers/gpu/drm/vc4/vc4_vec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
index bd5b8eb58b18..924e03050dd4 100644
--- a/drivers/gpu/drm/vc4/vc4_vec.c
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
@@ -403,7 +403,7 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder)
struct vc4_vec *vec = vc4_vec_encoder->vec;
int ret;
- ret = pm_runtime_get_sync(&vec->pdev->dev);
+ ret = pm_runtime_resume_and_get(&vec->pdev->dev);
if (ret < 0) {
DRM_ERROR("Failed to retain power domain: %d\n", ret);
return;
reply other threads:[~2021-04-09 0:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210409003855.56606-1-cuibixuan@huawei.com \
--to=cuibixuan@huawei.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric@anholt.net \
--cc=john.wanghui@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).