]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/nouveau: fix reference count leak in nv50_disp_atomic_commit
authorAditya Pakki <pakki001@umn.edu>
Sun, 14 Jun 2020 01:29:18 +0000 (20:29 -0500)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 24 Jul 2020 08:50:49 +0000 (18:50 +1000)
nv50_disp_atomic_commit() calls calls pm_runtime_get_sync and in turn
increments the reference count. In case of failure, decrement the
ref count before returning the error.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/dispnv50/disp.c

index 4c2894d8e15bdffaeaeda2bca1db6c457e485cdb..f4921460dbef374b18c871c1d813b8d452e903af 100644 (file)
@@ -2171,8 +2171,10 @@ nv50_disp_atomic_commit(struct drm_device *dev,
        int ret, i;
 
        ret = pm_runtime_get_sync(dev->dev);
-       if (ret < 0 && ret != -EACCES)
+       if (ret < 0 && ret != -EACCES) {
+               pm_runtime_put_autosuspend(dev->dev);
                return ret;
+       }
 
        ret = drm_atomic_helper_setup_commit(state, nonblock);
        if (ret)