Skip to content

Commit cb359c6

Browse files
harshimogalapallitursulin
authored andcommitted
drm/i915/huc: Fix missing error code in intel_huc_init()
Smatch warns: drivers/gpu/drm/i915/gt/uc/intel_huc.c:388 intel_huc_init() warn: missing error code 'err' When the allocation of VMAs fail: The value of err is zero at this point and it is passed to PTR_ERR and also finally returning zero which is success instead of failure. Fix this by adding the missing error code when VMA allocation fails. Fixes: 08872cb ("drm/i915/mtl/huc: auth HuC via GSC") Signed-off-by: Harshit Mogalapalli <[email protected]> Reviewed-by: Daniele Ceraolo Spurio <[email protected]> Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit ce432fd) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent 21f7735 commit cb359c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/i915/gt/uc/intel_huc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ int intel_huc_init(struct intel_huc *huc)
384384

385385
vma = intel_guc_allocate_vma(&gt->uc.guc, PXP43_HUC_AUTH_INOUT_SIZE * 2);
386386
if (IS_ERR(vma)) {
387+
err = PTR_ERR(vma);
387388
huc_info(huc, "Failed to allocate heci pkt\n");
388389
goto out;
389390
}

0 commit comments

Comments
 (0)