Skip to contentSkip to conversation

drm/amdgpu: Fix the incomplete product number

PATCH In review Roy Sun 3 participants 4 messages Jul 22, 2022 – Jul 25, 2022

Subsystems (2)
lore
Share & tools
lore

Roy Sun

author
#0 lore raw

PATCH 1/1 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

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
index 9f729a648005..187e3dae3965 100644
@@ -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];
 
Signature · 1 line
2.34.1
author
#1 lore raw

[AMD Official Use Only - General]

Ping

-----Original Message-----
From: Roy Sun <[email protected]>
Sent: Friday, July 22, 2022 12:57 PM
To: [email protected]
Cc: Sun, Roy <[email protected]>
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

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
index 9f729a648005..187e3dae3965 100644
@@ -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

Reviewed-by
#2 lore raw
Quoted 36 lines · Roy

[AMD Official Use Only - General]

Ping

-----Original Message-----
From: Roy Sun <[email protected]>
Sent: Friday, July 22, 2022 12:57 PM
To: [email protected]
Cc: Sun, Roy <[email protected]>
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

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -2
index 9f729a648005..187e3dae3965 100644
@@ -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

Reviewed-by on v1 1/1
#3 lore raw
In reply to Roy Sun

Às 01:56 de 22/07/22, Roy Sun escreveu:

Quoted 9 lines

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

---

Next time, please make your subject as [PATCH v2] and add a changelog to make review easier.