Skip to content

Commit 00583fb

Browse files
dinghaoliuBen Skeggs
authored andcommitted
drm/nouveau/debugfs: 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. Signed-off-by: Dinghao Liu <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
1 parent 9d4296a commit 00583fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/gpu/drm/nouveau/nouveau_debugfs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,11 @@ nouveau_debugfs_pstate_set(struct file *file, const char __user *ubuf,
181181
}
182182

183183
ret = pm_runtime_get_sync(drm->dev);
184-
if (ret < 0 && ret != -EACCES)
184+
if (ret < 0 && ret != -EACCES) {
185+
pm_runtime_put_autosuspend(drm->dev);
185186
return ret;
187+
}
188+
186189
ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args));
187190
pm_runtime_put_autosuspend(drm->dev);
188191
if (ret < 0)

0 commit comments

Comments
 (0)