From: Roy Sun Date: Wed, 20 Jul 2022 08:19:50 +0000 (+0800) Subject: drm/amdgpu: Fix the incomplete product number X-Git-Tag: baikal/aarch64/sdk6.1~3388^2^2~51 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=b91137faf45f6a42a129163f77ede012eea35d77;p=kernel.git drm/amdgpu: Fix the incomplete product number The comments say that the product number is a 16-digit HEX string so the buffer needs to be at least 17 characters to hold the NUL terminator. Expand the buffer size to 20 to avoid the alignment issues. The comment:Product number should only be 16 characters. Any more,and something could be wrong. Cap it at 16 to be safe Signed-off-by: Roy Sun Reviewed-by: André Almeida Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index b075845a53287..e146810c700ba 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1020,7 +1020,7 @@ struct amdgpu_device { bool psp_sysfs_en; /* Chip product information */ - char product_number[16]; + char product_number[20]; char product_name[AMDGPU_PRODUCT_NAME_LEN]; char serial[20];