Skip to content

Commit 69c0f07

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 <christian.koenig@amd.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: Kees Cook <keescook@chromium.org>
1 parent 0c1195c commit 69c0f07

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

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)