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

Huang, Tim Tim.Huang at amd.com
Tue Apr 30 03:31:52 UTC 2024


[Public]

Ping ...
> -----Original Message-----
> From: Huang, Tim <Tim.Huang at amd.com>
> Sent: Friday, April 26, 2024 9:14 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig, Christian
> <Christian.Koenig at amd.com>; Huang, Tim <Tim.Huang at amd.com>
> Subject: [PATCH] drm/amdgpu: fix uninitialized scalar variable warning
>
> Clear warning that field bp is uninitialized when calling
> amdgpu_virt_ras_add_bps.
>
> Signed-off-by: Tim Huang <Tim.Huang at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> index 54ab51a4ada7..a2f15edfe812 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> @@ -395,6 +395,8 @@ static void amdgpu_virt_add_bad_page(struct
> amdgpu_device *adev,
>       else
>               vram_usage_va = adev->mman.drv_vram_usage_va;
>
> +     memset(&bp, 0, sizeof(struct eeprom_table_record));
> +
>       if (bp_block_size) {
>               bp_cnt = bp_block_size / sizeof(uint64_t);
>               for (bp_idx = 0; bp_idx < bp_cnt; bp_idx++) {
> --
> 2.39.2



More information about the amd-gfx mailing list