[coreboot-gerrit] Change in coreboot[master]: libpayload: corebootfb: Add null check for framebuffer address

Duncan Laurie (Code Review) gerrit at coreboot.org
Mon Jun 26 11:00:35 CEST 2017


Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/20368


Change subject: libpayload: corebootfb: Add null check for framebuffer address
......................................................................

libpayload: corebootfb: Add null check for framebuffer address

If the framebuffer address is zero the corebootfb_init() function
should abort and not attempt to use it for video, otherwise it
will likely hang.

This was tested by booting on a board that does not have a display
attached and includes the previous patch to zero the framebuffer
structure in the coreboot tables.

Change-Id: I53ca2e947a7915cebb31b51e11ac6c310d9d6c55
Signed-off-by: Duncan Laurie <dlaurie at chromium.org>
---
M payloads/libpayload/drivers/video/corebootfb.c
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/20368/1

diff --git a/payloads/libpayload/drivers/video/corebootfb.c b/payloads/libpayload/drivers/video/corebootfb.c
index 46f891f..1aeac12 100644
--- a/payloads/libpayload/drivers/video/corebootfb.c
+++ b/payloads/libpayload/drivers/video/corebootfb.c
@@ -237,6 +237,8 @@
 	fbinfo = virt_to_phys(lib_sysinfo.framebuffer);
 
 	fbaddr = FI->physical_address;
+	if (fbaddr == 0)
+		return -1;
 
 	coreboot_video_console.columns = FI->x_resolution / FONT_WIDTH;
 	coreboot_video_console.rows = FI->y_resolution / FONT_HEIGHT;

-- 
To view, visit https://review.coreboot.org/20368
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I53ca2e947a7915cebb31b51e11ac6c310d9d6c55
Gerrit-Change-Number: 20368
Gerrit-PatchSet: 1
Gerrit-Owner: Duncan Laurie <dlaurie at chromium.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170626/37388ca7/attachment.html>


More information about the coreboot-gerrit mailing list