Re: [PATCH] drm/efidrm: ensure screen_base is initialized

From: Javier Martinez Canillas
Date: Fri Apr 11 2025 - 09:13:41 EST


Arnd Bergmann <arnd@xxxxxxxxxx> writes:

Hello Arnd,

> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> clang points out that there is a code path that leads to undefined behavior:
>
> drivers/gpu/drm/sysfb/efidrm.c:353:11: error: variable 'screen_base' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
> 353 | else if (mem_flags & EFI_MEMORY_WB)
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
>
> Add the missing initialization.
>
> Fixes: 32ae90c66fb6 ("drm/sysfb: Add efidrm for EFI displays")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---

A similar patch has been proposed by Nathan already and acked by Thomas:

https://lists.freedesktop.org/archives/dri-devel/2025-April/500539.html

--
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat