[PATCH] drm/dma: Drop unbalanced obj unref

Rob Clark robdclark at gmail.com
Thu Jan 19 21:13:25 UTC 2023


From: Rob Clark <robdclark at chromium.org>

In the error path, drm_gem_dma_mmap() is dropping an obj reference that
it doesn't own.

Fixes: f5ca8eb6f9bd ("drm/cma-helper: Implement mmap as GEM CMA object functions")
Signed-off-by: Rob Clark <robdclark at chromium.org>
---
 drivers/gpu/drm/drm_gem_dma_helper.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c
index 1e658c448366..784356d6f39d 100644
--- a/drivers/gpu/drm/drm_gem_dma_helper.c
+++ b/drivers/gpu/drm/drm_gem_dma_helper.c
@@ -544,8 +544,6 @@ int drm_gem_dma_mmap(struct drm_gem_dma_object *dma_obj, struct vm_area_struct *
 				  dma_obj->dma_addr,
 				  vma->vm_end - vma->vm_start);
 	}
-	if (ret)
-		drm_gem_vm_close(vma);
 
 	return ret;
 }
-- 
2.38.1



More information about the dri-devel mailing list