Skip to contentSkip to conversation

drivers: video: efi-gop: fix null reference pointer on priv->fb.mode=NULL.

PATCH Applied [email protected] 3 participants 3 messages Aug 28, 2025 – Sep 4, 2025 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: video: efi-gop: fix null reference pointer on priv->fb.mode=NULL.

From: Chali Anis <[email protected]>

fix a null reference pointer on mode variable, that was never initialized, the mode will be set by the framebuffer subsyetem after initialisation so it's not necessary to change the resolution here.

Fixes 6518b21c6c66 ("video: add EFI Graphics Output Protocol support")
---
 drivers/video/efi_gop.c | 2 --
 1 file changed, 2 deletions(-)
drivers/video/efi_gop.c +0 -2
index f4f58d9271f5..cef8a6816cac 100644
@@ -169,8 +169,6 @@ static int efi_gop_query(struct efi_gop_priv *priv)
 
 	priv->fb.screen_base = mode->frame_buffer_base;
 	priv->mode = mode->mode;
-	priv->fb.xres = priv->fb.mode->xres;
-	priv->fb.yres = priv->fb.mode->yres;
 
 	return 0;
 }
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 9 lines · On 8/28/25 6:14 AM, [email protected] wrote:

From: Chali Anis <[email protected]>

fix a null reference pointer on mode variable, that was never initialized, the mode will be set by the framebuffer subsyetem after initialisation so it's not necessary to change the resolution here.

Fixes 6518b21c6c66 ("video: add EFI Graphics Output Protocol support")

Uhh, so this has always been a null pointer dereference so far, but NULL page read didn't trap for us on x86..?

Anyways:

Thanks,
Ahmad

Quoted 17 lines
---
 drivers/video/efi_gop.c | 2 --
 1 file changed, 2 deletions(-)
drivers/video/efi_gop.c +0 -2
index f4f58d9271f5..cef8a6816cac 100644
@@ -169,8 +169,6 @@ static int efi_gop_query(struct efi_gop_priv *priv)
 
 	priv->fb.screen_base = mode->frame_buffer_base;
 	priv->mode = mode->mode;
-	priv->fb.xres = priv->fb.mode->xres;
-	priv->fb.yres = priv->fb.mode->yres;
 
 	return 0;
 }
Signature · 4 lines
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
Applied
#2 lore raw
In reply to [email protected]
Quoted 8 lines · On Thu, 28 Aug 2025 00:14:19 -0400, [email protected] wrote:

fix a null reference pointer on mode variable, that was never initialized, the mode will be set by the framebuffer subsyetem after initialisation so it's not necessary to change the resolution here.

Fixes 6518b21c6c66 ("video: add EFI Graphics Output Protocol support")

[...]

Applied, thanks!

[1/1] drivers: video: efi-gop: fix null reference pointer on priv->fb.mode=NULL.
https://git.pengutronix.de/cgit/barebox/commit/?id=33d2188b0b95 (link may not be stable)

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>