[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200614065611.69502-1-navid.emamdoost@gmail.com>
Date: Sun, 14 Jun 2020 01:56:11 -0500
From: Navid Emamdoost <navid.emamdoost@...il.com>
To: Eric Anholt <eric@...olt.net>, David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Cc: emamd001@....edu, wu000273@....edu, kjlu@....edu, smccaman@....edu,
Navid Emamdoost <navid.emamdoost@...il.com>
Subject: [PATCH] drm/vc4: fix ref count leak in vc4_v3d_pm_get
in vc4_v3d_pm_get, the call to pm_runtime_get_sync increments the
counter even in case of failure, leading to incorrect
ref count. In case of failure, decrement the ref count before returning.
Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
---
drivers/gpu/drm/vc4/vc4_v3d.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
index cea77a21b205..bb03c1d1bb4d 100644
--- a/drivers/gpu/drm/vc4/vc4_v3d.c
+++ b/drivers/gpu/drm/vc4/vc4_v3d.c
@@ -135,6 +135,7 @@ vc4_v3d_pm_get(struct vc4_dev *vc4)
if (ret < 0) {
vc4->power_refcount--;
+ pm_runtime_put(&vc4->v3d->pdev->dev);
mutex_unlock(&vc4->power_lock);
return ret;
}
--
2.17.1
Powered by blists - more mailing lists