[PATCH] drm/efidrm: ensure screen_base is initialized

Javier Martinez Canillas javierm at redhat.com
Fri Apr 11 13:11:08 UTC 2025


Arnd Bergmann <arnd at kernel.org> writes:

Hello Arnd,

> From: Arnd Bergmann <arnd at arndb.de>
>
> 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 at arndb.de>
> ---

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



More information about the dri-devel mailing list