Skip to contentSkip to conversation

drm/vc4: fix ref count leak in vc4_v3d_pm_get

PATCH New Navid Emamdoost 1 participant 1 message Jun 14, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/vc4/vc4_v3d.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/vc4/vc4_v3d.c +1 -0
index cea77a21b205..bb03c1d1bb4d 100644
@@ -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;
 		}
Signature · 1 line
2.17.1