Skip to contentSkip to conversation

drm/v3d: fix runtime pm imbalance on error

PATCH New Dinghao Liu 1 participant 1 message May 20, 2020

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

PATCH 1/1 drm/v3d: fix runtime pm imbalance on error

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.

---
 drivers/gpu/drm/v3d/v3d_gem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/v3d/v3d_gem.c +3 -1
index 549dde83408b..d53c683ed74c 100644
@@ -440,8 +440,10 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv,
 	job->free = free;
 
 	ret = pm_runtime_get_sync(v3d->dev);
-	if (ret < 0)
+	if (ret < 0) {
+		pm_runtime_put_autosuspend(v3d->dev);
 		return ret;
+	}
 
 	xa_init_flags(&job->deps, XA_FLAGS_ALLOC);
 
Signature · 1 line
2.17.1