[PATCH] drm/vesadrm: Avoid NULL-ptr deref in vesadrm_pmi_cmap_write()

Javier Martinez Canillas javierm at redhat.com
Fri Jun 27 07:36:48 UTC 2025


Thomas Zimmermann <tzimmermann at suse.de> writes:

Hello Thomas,

> Only set PMI fields if the screen_info's Vesa PM segment has been
> set. Vesa PMI is the power-management interface. It also provides
> means to set the color palette. The interface is optional, so not
> all VESA graphics cards support it. Print vesafb's warning [1] if
> the hardware palette cannot be set at all.
>
> If unsupported the field PrimaryPalette in struct vesadrm.pmi is
> NULL, which results in a segmentation fault. Happens with qemu's
> Cirrus emulation.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> Fixes: 814d270b31d2 ("drm/sysfb: vesadrm: Add gamma correction")
> Link: https://elixir.bootlin.com/linux/v6.15/source/drivers/video/fbdev/vesafb.c#L375 # 1
> Cc: Thomas Zimmermann <tzimmermann at suse.de>
> Cc: Javier Martinez Canillas <javierm at redhat.com>
> Cc: dri-devel at lists.freedesktop.org
> ---

Acked-by: Javier Martinez Canillas <javierm at redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



More information about the dri-devel mailing list