Skip to content

Commit c6cb77c

Browse files
en4bzzackr
authored andcommitted
drm/vmwgfx: Don't overwrite KMS surface dirty tracker
We were overwriting the surface's dirty tracker here causing a memory leak. Reported-by: Mika Penttilä <[email protected]> Closes: https://lore.kernel.org/dri-devel/[email protected]/ Fixes: 9655441 ("drm/vmwgfx: Refactor cursor handling") Signed-off-by: Ian Forbes <[email protected]> Reviewed-by: Maaz Mombasawala <[email protected]> Signed-off-by: Zack Rusin <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent c7feff2 commit c6cb77c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,8 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev,
771771
ret = vmw_bo_dirty_add(bo);
772772
if (!ret && surface && surface->res.func->dirty_alloc) {
773773
surface->res.coherent = true;
774-
ret = surface->res.func->dirty_alloc(&surface->res);
774+
if (surface->res.dirty == NULL)
775+
ret = surface->res.func->dirty_alloc(&surface->res);
775776
}
776777
ttm_bo_unreserve(&bo->tbo);
777778
}

0 commit comments

Comments
 (0)