]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/nouveau: fix nouveau_vma object leak
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Thu, 23 Jun 2011 14:34:30 +0000 (16:34 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Sun, 26 Jun 2011 23:20:12 +0000 (09:20 +1000)
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_gem.c

index 022393777805fd15672e67f38a2ab92b1da8b78f..5f0bc57fdaab5e14f1c3bc9f6e049f02c43a5069 100644 (file)
@@ -113,8 +113,10 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)
 
        vma = nouveau_bo_vma_find(nvbo, fpriv->vm);
        if (vma) {
-               if (--vma->refcount == 0)
+               if (--vma->refcount == 0) {
                        nouveau_bo_vma_del(nvbo, vma);
+                       kfree(vma);
+               }
        }
        ttm_bo_unreserve(&nvbo->bo);
 }