]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/vmwgfx: Add error path for xa_store in vmw_bo_add_detached_resource
authorKeisuke Nishimura <keisuke.nishimura@inria.fr>
Tue, 25 Feb 2025 14:52:23 +0000 (15:52 +0100)
committerZack Rusin <zack.rusin@broadcom.com>
Mon, 10 Mar 2025 18:31:43 +0000 (14:31 -0400)
commit3282422bf251db541fe07c548ca304130d37d754
treed19d6030c4359b6327bb415507dd3e14c6531944
parent0039a3b35b10d9c15d3d26320532ab56cc566750
drm/vmwgfx: Add error path for xa_store in vmw_bo_add_detached_resource

The xa_store() may fail due to memory allocation failure because there
is no guarantee that the index is already used. This fix introduces new
paths to handle the error.

This patch also aligns the order of function calls by calling
vmw_bo_add_detached_resource() before ttm_prime_object_init() in order
to allow consistent error handling.

Fixes: d6667f0ddf46 ("drm/vmwgfx: Fix handling of dumb buffers")
Signed-off-by: Keisuke Nishimura <keisuke.nishimura@inria.fr>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250225145223.34773-1-keisuke.nishimura@inria.fr
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
drivers/gpu/drm/vmwgfx/vmwgfx_bo.h
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c