Skip to content

Commit d3ded53

Browse files
ShuichengLinrodrigovivi
authored andcommitted
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: 2e5d47f ("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> (cherry picked from commit 71d61e3) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent 6eb0168 commit d3ded53

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/gpu/drm/xe/xe_gsc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,7 @@ int xe_gsc_init_post_hwconfig(struct xe_gsc *gsc)
482482
EXEC_QUEUE_FLAG_PERMANENT, 0);
483483
if (IS_ERR(q)) {
484484
xe_gt_err(gt, "Failed to create queue for GSC submission\n");
485-
err = PTR_ERR(q);
486-
goto out_bo;
485+
return PTR_ERR(q);
487486
}
488487

489488
wq = alloc_ordered_workqueue("gsc-ordered-wq", 0);
@@ -506,8 +505,6 @@ int xe_gsc_init_post_hwconfig(struct xe_gsc *gsc)
506505

507506
out_q:
508507
xe_exec_queue_put(q);
509-
out_bo:
510-
xe_bo_unpin_map_no_vm(bo);
511508
return err;
512509
}
513510

0 commit comments

Comments
 (0)