diff options
author | Andrew Jones <ajones@ventanamicro.com> | 2022-07-18 19:20:26 +0200 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-07-30 11:39:10 +0530 |
commit | 7d28d3be50c5f8b9e4780a305ab3c39062e486c1 (patch) | |
tree | 5a4cfc8ec0038fd3ecc327fd13938ac69085e985 /platform/fpga | |
parent | 8e86b23db9cab91d395c53d461b012ff69e63f64 (diff) | |
download | opensbi-7d28d3be50c5f8b9e4780a305ab3c39062e486c1.zip opensbi-7d28d3be50c5f8b9e4780a305ab3c39062e486c1.tar.gz opensbi-7d28d3be50c5f8b9e4780a305ab3c39062e486c1.tar.bz2 |
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 <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'platform/fpga')
-rw-r--r-- | platform/fpga/openpiton/platform.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |