summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Jones <ajones@ventanamicro.com>2022-07-18 20:20:26 +0300
committerAnup Patel <anup@brainfault.org>2022-07-30 09:09:10 +0300
commit7d28d3be50c5f8b9e4780a305ab3c39062e486c1 (patch)
tree5a4cfc8ec0038fd3ecc327fd13938ac69085e985 /lib
parent8e86b23db9cab91d395c53d461b012ff69e63f64 (diff)
downloadopensbi-7d28d3be50c5f8b9e4780a305ab3c39062e486c1.tar.xz
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 'lib')
-rw-r--r--lib/utils/serial/fdt_serial_gaisler.c2
-rw-r--r--lib/utils/serial/fdt_serial_shakti.c2
-rw-r--r--lib/utils/serial/fdt_serial_sifive.c2
-rw-r--r--lib/utils/serial/fdt_serial_uart8250.c2
-rw-r--r--lib/utils/serial/fdt_serial_xlnx_uartlite.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/utils/serial/fdt_serial_gaisler.c b/lib/utils/serial/fdt_serial_gaisler.c
index 9a9f9a8..74988e3 100644
--- a/lib/utils/serial/fdt_serial_gaisler.c
+++ b/lib/utils/serial/fdt_serial_gaisler.c
@@ -15,7 +15,7 @@ static int serial_gaisler_init(void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
- struct platform_uart_data uart;
+ struct platform_uart_data uart = { 0 };
rc = fdt_parse_gaisler_uart_node(fdt, nodeoff, &uart);
if (rc)
diff --git a/lib/utils/serial/fdt_serial_shakti.c b/lib/utils/serial/fdt_serial_shakti.c
index 4f91419..0e05630 100644
--- a/lib/utils/serial/fdt_serial_shakti.c
+++ b/lib/utils/serial/fdt_serial_shakti.c
@@ -13,7 +13,7 @@ static int serial_shakti_init(void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
- struct platform_uart_data uart;
+ struct platform_uart_data uart = { 0 };
rc = fdt_parse_shakti_uart_node(fdt, nodeoff, &uart);
if (rc)
diff --git a/lib/utils/serial/fdt_serial_sifive.c b/lib/utils/serial/fdt_serial_sifive.c
index f4c833c..3ca1091 100644
--- a/lib/utils/serial/fdt_serial_sifive.c
+++ b/lib/utils/serial/fdt_serial_sifive.c
@@ -15,7 +15,7 @@ static int serial_sifive_init(void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
- struct platform_uart_data uart;
+ struct platform_uart_data uart = { 0 };
rc = fdt_parse_sifive_uart_node(fdt, nodeoff, &uart);
if (rc)
diff --git a/lib/utils/serial/fdt_serial_uart8250.c b/lib/utils/serial/fdt_serial_uart8250.c
index 544b741..0b95f2d 100644
--- a/lib/utils/serial/fdt_serial_uart8250.c
+++ b/lib/utils/serial/fdt_serial_uart8250.c
@@ -15,7 +15,7 @@ static int serial_uart8250_init(void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
- struct platform_uart_data uart;
+ struct platform_uart_data uart = { 0 };
rc = fdt_parse_uart8250_node(fdt, nodeoff, &uart);
if (rc)
diff --git a/lib/utils/serial/fdt_serial_xlnx_uartlite.c b/lib/utils/serial/fdt_serial_xlnx_uartlite.c
index 466e16e..9f04aea 100644
--- a/lib/utils/serial/fdt_serial_xlnx_uartlite.c
+++ b/lib/utils/serial/fdt_serial_xlnx_uartlite.c
@@ -15,7 +15,7 @@ static int serial_xlnx_uartlite_init(void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
- struct platform_uart_data uart;
+ struct platform_uart_data uart = { 0 };
rc = fdt_parse_xlnx_uartlite_node(fdt, nodeoff, &uart);
if (rc)