Skip to content

Commit 72f211f

Browse files
ShuichengLingregkh
authored andcommitted
drm/xe/gsc: Fix BO leak on error in query_compatibility_version()
[ Upstream commit 3762d6c ] When xe_gsc_read_out_header() fails, query_compatibility_version() returns directly instead of jumping to the out_bo label. This skips the xe_bo_unpin_map_no_vm() call, leaving the BO pinned and mapped with no remaining reference to free it. Fix by using goto out_bo so the error path properly cleans up the BO, consistent with the other error handling in the same function. Fixes: 0881cbe ("drm/xe/gsc: Query GSC compatibility version") Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Link: https://patch.msgid.link/20260417163308.3416147-1-shuicheng.lin@intel.com Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> (cherry picked from commit 8de86d0) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f93b001 commit 72f211f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/xe/xe_gsc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int query_compatibility_version(struct xe_gsc *gsc)
163163
&rd_offset);
164164
if (err) {
165165
xe_gt_err(gt, "HuC: invalid GSC reply for version query (err=%d)\n", err);
166-
return err;
166+
goto out_bo;
167167
}
168168

169169
compat->major = version_query_rd(xe, &bo->vmap, rd_offset, proj_major);

0 commit comments

Comments
 (0)