[coreboot-gerrit] Change in coreboot[master]: drivers/uart8250mem: Check for zero base address

Marshall Dawson (Code Review) gerrit at coreboot.org
Thu Oct 12 19:31:48 CEST 2017


Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/21996


Change subject: drivers/uart8250mem: Check for zero base address
......................................................................

drivers/uart8250mem: Check for zero base address

Before adding a new UART to the coreboot/lb table, verify that it
has a non-zero base address.  This is consistent with all other
functions that use the uart_platform_base() function.

This was tested on google/kahlee by using an invalid UART number
and forcing the base address to 0.  Execution was able to complete
through depthcharge and into the OS.

Change-Id: I6d8183a461f0fedc254bf88de5ec96629a2a80ef
Signed-off-by: Marshall Dawson <marshalldawson3rd at gmail.com>
---
M src/drivers/uart/uart8250mem.c
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/21996/1

diff --git a/src/drivers/uart/uart8250mem.c b/src/drivers/uart/uart8250mem.c
index f293230..9eb50cb 100644
--- a/src/drivers/uart/uart8250mem.c
+++ b/src/drivers/uart/uart8250mem.c
@@ -154,6 +154,8 @@
 	struct lb_serial serial;
 	serial.type = LB_SERIAL_TYPE_MEMORY_MAPPED;
 	serial.baseaddr = uart_platform_base(CONFIG_UART_FOR_CONSOLE);
+	if (!serial.baseaddr)
+		return;
 	serial.baud = CONFIG_TTYS0_BAUD;
 	if (IS_ENABLED(CONFIG_DRIVERS_UART_8250MEM_32))
 		serial.regwidth = sizeof(uint32_t);

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d8183a461f0fedc254bf88de5ec96629a2a80ef
Gerrit-Change-Number: 21996
Gerrit-PatchSet: 1
Gerrit-Owner: Marshall Dawson <marshalldawson3rd at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171012/8627b9d7/attachment.html>


More information about the coreboot-gerrit mailing list