mirror_ubuntu-kernels/drivers/gpu/drm/amd/pm
Srinivasan Shanmugam 730dd50f84 drm/amdgpu: Fix truncation in smu_v11_0_init_microcode
Reducing the size of ucode_prefix to 25 in the smu_v11_0_init_microcode
function. we ensure that fw_name can accommodate the maximum possible
string size

Fixes the below with gcc W=1:
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c: In function ‘smu_v11_0_init_microcode’:
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c:110:54: warning: ‘.bin’ directive output may be truncated writing 4 bytes into a region of size between 0 and 29 [-Wformat-truncation=]
  110 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
      |                                                      ^~~~
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c:110:9: note: ‘snprintf’ output between 12 and 41 bytes into a destination of size 36
  110 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2024-03-22 15:56:28 -04:00
..
inc drm/amdgpu: implement smu send rma reason for smu v13.0.6 2024-02-12 16:08:17 -05:00
legacy-dpm Revert "drm/amd/pm: resolve reboot exception for si oland" 2024-02-27 11:07:10 -05:00
powerplay drm/amdgpu: fix wrong sizeof argument 2024-01-22 17:13:25 -05:00
swsmu drm/amdgpu: Fix truncation in smu_v11_0_init_microcode 2024-03-22 15:56:28 -04:00
amdgpu_dpm_internal.c drm/amd/pm: add missing prototypes to amdgpu_dpm_internal 2022-02-07 18:03:50 -05:00
amdgpu_dpm.c drm/amdgpu: implement smu send rma reason for smu v13.0.6 2024-02-12 16:08:17 -05:00
amdgpu_pm.c drm/amd/pm set pp_dpm_*clk as read only for SRIOV one VF mode 2024-03-22 15:50:12 -04:00
Makefile drm/amd/swsmu: add smu14 ip support 2023-10-13 10:59:55 -04:00