drm/amd/amdgpu/imu_v11_0: Increase buffer size to ensure all possible values can...
authorLee Jones <lee@kernel.org>
Thu, 24 Aug 2023 07:37:05 +0000 (08:37 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 30 Aug 2023 19:27:18 +0000 (15:27 -0400)
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/imu_v11_0.c: In function ‘imu_v11_0_init_microcode’:
 drivers/gpu/drm/amd/amdgpu/imu_v11_0.c:52:54: warning: ‘_imu.bin’ directive output may be truncated writing 8 bytes into a region of size between 4 and 33 [-Wformat-truncation=]
 drivers/gpu/drm/amd/amdgpu/imu_v11_0.c:52:9: note: ‘snprintf’ output between 16 and 45 bytes into a destination of size 40

Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/imu_v11_0.c

index 8f954c737c4841aaa1fde5c4d8be142dde359c1d..0a8bc6c94fa94da99663c2a6280d7f66c610be7a 100644 (file)
@@ -40,7 +40,7 @@ MODULE_FIRMWARE("amdgpu/gc_11_5_0_imu.bin");
 
 static int imu_v11_0_init_microcode(struct amdgpu_device *adev)
 {
-       char fw_name[40];
+       char fw_name[45];
        char ucode_prefix[30];
        int err;
        const struct imu_firmware_header_v1_0 *imu_hdr;