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>
This commit is contained in:
parent
8e86b23db9
commit
7d28d3be50
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue