]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/xe: Fix dma-buf attachment leak in xe_gem_prime_import()
authorShuicheng Lin <shuicheng.lin@intel.com>
Wed, 8 Apr 2026 17:52:55 +0000 (17:52 +0000)
committerShuicheng Lin <shuicheng.lin@intel.com>
Tue, 14 Apr 2026 15:36:10 +0000 (08:36 -0700)
commita828eb185aac41800df8eae4b60501ccc0dbbe51
tree2c37951c77de8706eababce2bd59f6a2bb3e5d78
parent78a6c5f899f22338bbf48b44fb8950409c5a69b9
drm/xe: Fix dma-buf attachment leak in xe_gem_prime_import()

When xe_dma_buf_init_obj() fails, the attachment from
dma_buf_dynamic_attach() is not detached. Add dma_buf_detach() before
returning the error. Note: we cannot use goto out_err here because
xe_dma_buf_init_obj() already frees bo on failure, and out_err would
double-free it.

Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4.6
Reviewed-by: Mattheq Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260408175255.3402838-5-shuicheng.lin@intel.com
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
drivers/gpu/drm/xe/xe_dma_buf.c