[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210409003855.56606-1-cuibixuan@huawei.com>
Date: Fri, 9 Apr 2021 08:38:55 +0800
From: Bixuan Cui <cuibixuan@...wei.com>
To: <linux-kernel@...r.kernel.org>
CC: <john.wanghui@...wei.com>, <eric@...olt.net>, <mripard@...nel.org>,
<airlied@...ux.ie>, <daniel@...ll.ch>,
<dri-devel@...ts.freedesktop.org>,
Bixuan Cui <cuibixuan@...wei.com>
Subject: [PATCH] drm/vc4: Fix PM reference leak in vc4_vec_encoder_enable()
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@...wei.com>
Signed-off-by: Bixuan Cui <cuibixuan@...wei.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;
Powered by blists - more mailing lists