[PATCH v3] drm/amdgpu: fix uninitialized scalar variable warning

Christian König christian.koenig at amd.com
Tue Apr 23 16:27:13 UTC 2024


Am 23.04.24 um 16:31 schrieb Tim Huang:
> From: Tim Huang <Tim.Huang at amd.com>
>
> Clear warning that uses uninitialized value fw_size.
>
> Signed-off-by: Tim Huang <Tim.Huang at amd.com>

Reviewed-by: Christian König <christian.koenig at amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> index d95555dc5485..fb5de23fa8d8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> @@ -1205,7 +1205,8 @@ void amdgpu_gfx_cp_init_microcode(struct amdgpu_device *adev,
>   		fw_size = le32_to_cpu(cp_hdr_v2_0->data_size_bytes);
>   		break;
>   	default:
> -		break;
> +		dev_err(adev->dev, "Invalid ucode id %u\n", ucode_id);
> +		return;
>   	}
>   
>   	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {



More information about the amd-gfx mailing list