drm/xe/gsc: Fix double-free of managed BO in error path
authorShuicheng Lin <shuicheng.lin@intel.com>
Mon, 11 May 2026 15:41:34 +0000 (15:41 +0000)
committerShuicheng Lin <shuicheng.lin@intel.com>
Thu, 14 May 2026 15:24:03 +0000 (08:24 -0700)
commit71d61e3e299a17139e47f980a4d6f425b2c59bf7
tree7a8367e9bdc4473e9f8629ae03619d1f61a7f9b1
parent2ddedd4b7b7c329dd65358025cba8652675bec3d
drm/xe/gsc: Fix double-free of managed BO in error path

The error path in xe_gsc_init_post_hwconfig() explicitly frees a BO
allocated with xe_managed_bo_create_pin_map() via
xe_bo_unpin_map_no_vm(). Since the managed BO already has a devm
cleanup action registered, this causes a double-free when devm
unwinds during probe failure.

Remove the explicit free and let devm handle it, consistent with
all other xe_managed_bo_create_pin_map() callers.

Fixes: 2e5d47fe7839 ("drm/xe/uc: Use managed bo for HuC and GSC objects")
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Assisted-by: Claude:claude-opus-4.6
Link: https://patch.msgid.link/20260511154134.223696-1-shuicheng.lin@intel.com
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
drivers/gpu/drm/xe/xe_gsc.c