Skip to content

Commit d7372df

Browse files
dinghaoliuBen Skeggs
authored andcommitted
drm/nouveau: 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 00583fb commit d7372df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/nouveau/nouveau_gem.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)
7676
return ret;
7777

7878
ret = pm_runtime_get_sync(dev);
79-
if (ret < 0 && ret != -EACCES)
79+
if (ret < 0 && ret != -EACCES) {
80+
pm_runtime_put_autosuspend(dev);
8081
goto out;
82+
}
8183

8284
ret = nouveau_vma_new(nvbo, vmm, &vma);
8385
pm_runtime_mark_last_busy(dev);

0 commit comments

Comments
 (0)