From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Alex Deucher <alexander.deucher@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] drm/radeon: make -fstrict-flex-arrays=3 happy
Date: Mon, 15 Apr 2024 16:55:57 +0200 [thread overview]
Message-ID: <c2e4d05a-b245-4a33-acf8-54f650616d07@gmail.com> (raw)
In-Reply-To: <20240415133816.1053794-1-alexander.deucher@amd.com>
Am 15.04.24 um 15:38 schrieb Alex Deucher:
> 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")
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Cc: Kees Cook <keescook@chromium.org>
Acked-by: Christian König <christian.koenig@amd.com>
But I have a bad feeling messing with that old code.
Regards,
Christian.
> ---
> drivers/gpu/drm/radeon/radeon_atombios.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
> index bb1f0a3371ab5..10793a433bf58 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;
>
next prev parent reply other threads:[~2024-04-15 14:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 13:38 [PATCH] drm/radeon: make -fstrict-flex-arrays=3 happy Alex Deucher
2024-04-15 14:55 ` Christian König [this message]
2024-04-15 16:04 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c2e4d05a-b245-4a33-acf8-54f650616d07@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=keescook@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.