[v1 3/4] drm/amdgpu: bail out when failed to load fw in psp_init_cap_microcode()
Lazar, Lijo
lijo.lazar at amd.com
Fri Feb 7 11:05:53 UTC 2025
On 2/7/2025 11:58 AM, Jiang Liu wrote:
> In function psp_init_cap_microcode(), it should bail out when failed to
> load firmware, otherwise it may cause invalid memory access.
>
> Signed-off-by: Jiang Liu <gerry at linux.alibaba.com>
You may also add
Fixes: 07dbfc6b102e ("drm/amd: Use `amdgpu_ucode_*` helpers for PSP")
Reviewed-by: Lijo Lazar <lijo.lazar at amd.com>
Thanks,
Lijo
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 0d1eb7b8e59b..952da6c7943d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -3838,9 +3838,10 @@ int psp_init_cap_microcode(struct psp_context *psp, const char *chip_name)
> if (err == -ENODEV) {
> dev_warn(adev->dev, "cap microcode does not exist, skip\n");
> err = 0;
> - goto out;
> + } else {
> + dev_err(adev->dev, "fail to initialize cap microcode\n");
> }
> - dev_err(adev->dev, "fail to initialize cap microcode\n");
> + goto out;
> }
>
> info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CAP];
More information about the amd-gfx
mailing list