Skip to content

Commit 7eb3d65

Browse files
jiangliuaaron-ang
authored andcommitted
drm/amdgpu: bail out when failed to load fw in psp_init_cap_microcode()
In function psp_init_cap_microcode(), it should bail out when failed to load firmware, otherwise it may cause invalid memory access. Fixes: 07dbfc6 ("drm/amd: Use `amdgpu_ucode_*` helpers for PSP") Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Jiang Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent c1d1711 commit 7eb3d65

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3815,9 +3815,10 @@ int psp_init_cap_microcode(struct psp_context *psp, const char *chip_name)
38153815
if (err == -ENODEV) {
38163816
dev_warn(adev->dev, "cap microcode does not exist, skip\n");
38173817
err = 0;
3818-
goto out;
3818+
} else {
3819+
dev_err(adev->dev, "fail to initialize cap microcode\n");
38193820
}
3820-
dev_err(adev->dev, "fail to initialize cap microcode\n");
3821+
goto out;
38213822
}
38223823

38233824
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CAP];

0 commit comments

Comments
 (0)