From 8fe198b2c6fd8455db9f07d712ee54e2a1d02783 Mon Sep 17 00:00:00 2001 From: Marcin Slusarz Date: Thu, 23 Jun 2011 16:34:30 +0200 Subject: [PATCH] drm/nouveau: fix nouveau_vma object leak Signed-off-by: Marcin Slusarz Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_gem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 022393777805..5f0bc57fdaab 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -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); } -- 2.39.5