diff options
author | Alex Deucher <[email protected]> | 2024-04-14 22:06:08 -0400 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2024-04-16 22:39:16 -0400 |
commit | 69c0f070531cc9136576c53a6fc27992b88088ea (patch) | |
tree | 097ae48c20660426fc1beff1b91a538f903f5540 | |
parent | 0c1195ca0d02a3db2599738a944bb6a36f6fa234 (diff) |
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: df8fc4e934c1 ("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]>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index bb1f0a3371ab..10793a433bf5 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c @@ -923,8 +923,12 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct max_device = ATOM_MAX_SUPPORTED_DEVICE_INFO; for (i = 0; i < max_device; i++) { - ATOM_CONNECTOR_INFO_I2C ci = - supported_devices->info.asConnInfo[i]; + ATOM_CONNECTOR_INFO_I2C ci; + + if (frev > 1) + ci = supported_devices->info_2d1.asConnInfo[i]; + else + ci = supported_devices->info.asConnInfo[i]; bios_connectors[i].valid = false; |