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 0223937..5f0bc57 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);
 }