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@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;