From 13bc5e5c801668001044674e8efee93271863a2e Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Mon, 26 Jun 2017 01:50:14 -0700 Subject: lib/coreboot_tables: Zero framebuffer structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/20367 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Philipp Deppenwiese --- src/lib/coreboot_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/coreboot_table.c') diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c index aa6c7a51d6..52c18d051e 100644 --- a/src/lib/coreboot_table.c +++ b/src/lib/coreboot_table.c @@ -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; -- cgit v1.2.3