From 783982751d26161bb1cb0d923375fabd92940a0f Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Wed, 24 Jul 2019 11:12:09 -0600 Subject: cpu,mb,soc: Init missing lb_serial struct fields Initialize the input_hertz and uart_pci_addr fields of the lb_serial struct to prevent later undefined reads in lb_add_serial(). This was done for exynos5420 in commit ff94e00362 (soc/samsung/exynos5420/uart.c: Init new serial struct variables), and this patch finishes the rest. Note that not all of the drivers can have the UART PCI address configured at build time, so a follow-up patch will be needed to correct those ones. Change-Id: I733bc8185e2f2d28a9823495b53d6b09dce4deb1 Signed-off-by: Jacob Garber Found-by: Coverity CID 1354778 Reviewed-on: https://review.coreboot.org/c/coreboot/+/34548 Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- src/mainboard/emulation/qemu-power8/uart.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mainboard/emulation/qemu-power8/uart.c') diff --git a/src/mainboard/emulation/qemu-power8/uart.c b/src/mainboard/emulation/qemu-power8/uart.c index 7c7797139d..27eb2f4f8f 100644 --- a/src/mainboard/emulation/qemu-power8/uart.c +++ b/src/mainboard/emulation/qemu-power8/uart.c @@ -49,6 +49,9 @@ void uart_fill_lb(void *data) serial.baseaddr = 0; serial.baud = 115200; serial.regwidth = 1; + serial.input_hertz = uart_platform_refclk(); + serial.uart_pci_addr = CONFIG_UART_PCI_ADDR; lb_add_serial(&serial, data); + lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -- cgit v1.2.3