Skip to contentSkip to conversation

drm/amdgpu/atomfirmware: silence UBSAN warning

PATCH In review Alex Deucher 3 participants 3 messages Jul 1, 2024 – Jul 3, 2024

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu/atomfirmware: silence UBSAN warning

This is a variably sized array.

---
 drivers/gpu/drm/amd/include/atomfirmware.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/include/atomfirmware.h +1 -1
index 571691837200..09cbc3afd6d8 100644
@@ -734,7 +734,7 @@ struct atom_gpio_pin_lut_v2_1
 {
   struct  atom_common_table_header  table_header;
   /*the real number of this included in the structure is calcualted by using the (whole structure size - the header size)/size of atom_gpio_pin_lut  */
-  struct  atom_gpio_pin_assignment  gpio_pin[8];
+  struct  atom_gpio_pin_assignment  gpio_pin[];
 };
 
 
Signature · 1 line
2.45.2
Tested-by on v1 1/1
#1 lore raw
Quoted 18 lines · Alex Deucher

This is a variably sized array.

Link:
https://lists.freedesktop.org/archives/amd-gfx/2024-June/110420.html

---
 drivers/gpu/drm/amd/include/atomfirmware.h | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/include/atomfirmware.h +0 -0
index 571691837200..09cbc3afd6d8 100644
@@ -734,7 +734,7 @@ struct atom_gpio_pin_lut_v2_1
  {
    struct  atom_common_table_header  table_header;
    /*the real number of this included in the structure is calcualted
Quoted 7 lines

by using the (whole structure size - the header size)/size of atom_gpio_pin_lut  */
-  struct  atom_gpio_pin_assignment  gpio_pin[8];
+  struct  atom_gpio_pin_assignment  gpio_pin[];
 };

Works for me:

Acked-by on v1 1/1
#2 lore raw
In reply to Alex Deucher

[Public]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Monday, July 1, 2024 10:25 PM
To: [email protected]; [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu/atomfirmware: silence UBSAN warning

This is a variably sized array.

---
 drivers/gpu/drm/amd/include/atomfirmware.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/include/atomfirmware.h +1 -2
index 571691837200..09cbc3afd6d8 100644
@@ -734,7 +734,7 @@ struct atom_gpio_pin_lut_v2_1  {
   struct  atom_common_table_header  table_header;
   /*the real number of this included in the structure is calcualted by using the (whole structure size - the header size)/size of atom_gpio_pin_lut  */
-  struct  atom_gpio_pin_assignment  gpio_pin[8];
+  struct  atom_gpio_pin_assignment  gpio_pin[];
 };
 
 
--

2.45.2