Commit 0ba753bc authored by Alex Deucher's avatar Alex Deucher
Browse files

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: df8fc4e9 ("kbuild: Enable -fstrict-flex-arrays=3")
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: Kees Cook <keescook@chromium.org>
parent a6ff969f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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;