Skip to content

Commit 0ba753b

Browse files
committed
drm/radeon: make -fstrict-flex-arrays=3 happy
The driver parses a union where the layout up through the first array is the same, however, the array has different sizes depending on the elements in the union. Be explicit to fix the UBSAN checker. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3323 Fixes: df8fc4e ("kbuild: Enable -fstrict-flex-arrays=3") Acked-by: Christian König <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: Kees Cook <[email protected]>
1 parent a6ff969 commit 0ba753b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/gpu/drm/radeon/radeon_atombios.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,12 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct
923923
max_device = ATOM_MAX_SUPPORTED_DEVICE_INFO;
924924

925925
for (i = 0; i < max_device; i++) {
926-
ATOM_CONNECTOR_INFO_I2C ci =
927-
supported_devices->info.asConnInfo[i];
926+
ATOM_CONNECTOR_INFO_I2C ci;
927+
928+
if (frev > 1)
929+
ci = supported_devices->info_2d1.asConnInfo[i];
930+
else
931+
ci = supported_devices->info.asConnInfo[i];
928932

929933
bios_connectors[i].valid = false;
930934

0 commit comments

Comments
 (0)