]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/vmwgfx: Don't overwrite KMS surface dirty tracker
authorIan Forbes <ian.forbes@broadcom.com>
Mon, 2 Mar 2026 20:03:30 +0000 (14:03 -0600)
committerZack Rusin <zack.rusin@broadcom.com>
Mon, 16 Mar 2026 15:39:42 +0000 (11:39 -0400)
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: 965544150d1c ("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
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

index 55730e29d3ae9c5310a92eca29f9ad8b18e5f862..e7bddf840a7951017a3c86c2d3eb44745536fa81 100644 (file)
@@ -771,7 +771,8 @@ err_out:
                ret = vmw_bo_dirty_add(bo);
                if (!ret && surface && surface->res.func->dirty_alloc) {
                        surface->res.coherent = true;
-                       ret = surface->res.func->dirty_alloc(&surface->res);
+                       if (surface->res.dirty == NULL)
+                               ret = surface->res.func->dirty_alloc(&surface->res);
                }
                ttm_bo_unreserve(&bo->tbo);
        }