Re: [v1 3/4] drm/amdgpu: bail out when failed to load fw in psp_init_cap_microcode()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxxxxxxxxx>

You may also add

	Fixes: 07dbfc6b102e ("drm/amd: Use `amdgpu_ucode_*` helpers for PSP")

Reviewed-by: Lijo Lazar <lijo.lazar@xxxxxxx>

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];




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux