[PATCH] drm/amdgpu: Fix the incomplete product number

Sun, Roy Roy.Sun at amd.com
Mon Jul 25 07:29:36 UTC 2022


[AMD Official Use Only - General]

Ping

-----Original Message-----
From: Roy Sun <Roy.Sun at amd.com> 
Sent: Friday, July 22, 2022 12:57 PM
To: amd-gfx at lists.freedesktop.org
Cc: Sun, Roy <Roy.Sun at amd.com>
Subject: [PATCH] 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 <Roy.Sun at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 9f729a648005..187e3dae3965 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1019,7 +1019,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];
 
--
2.34.1


More information about the amd-gfx mailing list