From 7d28d3be50c5f8b9e4780a305ab3c39062e486c1 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 18 Jul 2022 19:20:26 +0200 Subject: lib: utils/serial: Initialize platform_uart_data to zero While it doesn't look like there are any current cases of using uninitialized data, let's zero all the UART data members to be safe. Zero may not actually be better than a random number in some cases, so all structure members should still be validated before use, but at least zero is usually easier to debug than some random stack garbage... Signed-off-by: Andrew Jones Reviewed-by: Anup Patel --- platform/fpga/openpiton/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/fpga/openpiton/platform.c b/platform/fpga/openpiton/platform.c index 7ca2123..5ff7d20 100644 --- a/platform/fpga/openpiton/platform.c +++ b/platform/fpga/openpiton/platform.c @@ -69,7 +69,7 @@ static struct aclint_mtimer_data mtimer = { static int openpiton_early_init(bool cold_boot) { void *fdt; - struct platform_uart_data uart_data; + struct platform_uart_data uart_data = { 0 }; struct plic_data plic_data; unsigned long aclint_freq; uint64_t clint_addr; -- cgit v1.2.3