lib/coreboot_tables: Zero framebuffer structure

Zero the framebuffer structure so if it is not filled in (either if
no display is present or if there is an error) then it does not
provide garbage data to the payload.

This was noticed when booting a board without a display attached as
the payload wrote to the framebuffer at a random address.

With this change the payload can properly handle the case where a
display is not attached and not corrupt memory.

Change-Id: I8114d88496cd2a4f2e7f07f377fe76f3180a7f40
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/20367
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
This commit is contained in:
Duncan Laurie 2017-06-26 01:50:14 -07:00
parent 8bd88341e8
commit 13bc5e5c80
1 changed files with 1 additions and 1 deletions

View File

@ -138,7 +138,7 @@ void lb_add_console(uint16_t consoletype, void *data)
static void lb_framebuffer(struct lb_header *header)
{
struct lb_framebuffer *framebuffer;
struct lb_framebuffer fb;
struct lb_framebuffer fb = {0};
if (!IS_ENABLED(CONFIG_LINEAR_FRAMEBUFFER) || fill_lb_framebuffer(&fb))
return;