Skip to content
/ linux Public

Commit 3f300a4

Browse files
en4bzgregkh
authored andcommitted
drm/vmwgfx: Don't overwrite KMS surface dirty tracker
[ Upstream commit c6cb77c ] We were overwriting the surface's dirty tracker here causing a memory leak. Reported-by: Mika Penttilä <mpenttil@redhat.com> Closes: https://lore.kernel.org/dri-devel/8c53f3c6-c6de-46fe-a8ca-d98dd52b3abe@redhat.com/ Fixes: 9655441 ("drm/vmwgfx: Refactor cursor handling") Signed-off-by: Ian Forbes <ian.forbes@broadcom.com> Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Link: https://patch.msgid.link/20260302200330.66763-1-ian.forbes@broadcom.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent bec21d9 commit 3f300a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,8 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev,
768768
ret = vmw_bo_dirty_add(bo);
769769
if (!ret && surface && surface->res.func->dirty_alloc) {
770770
surface->res.coherent = true;
771-
ret = surface->res.func->dirty_alloc(&surface->res);
771+
if (surface->res.dirty == NULL)
772+
ret = surface->res.func->dirty_alloc(&surface->res);
772773
}
773774
ttm_bo_unreserve(&bo->tbo);
774775
}

0 commit comments

Comments
 (0)