[PATCH 05/29] serial: mtk: initial priv data before using

Weijie Gao weijie.gao at mediatek.com
Wed Jul 19 11:16:07 CEST 2023


This patch ensures driver private data being fully initialized in
_debug_uart_init which is not covered by .priv_auto ops.

Signed-off-by: Sam Shih <sam.shih at mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao at mediatek.com>
---
 drivers/serial/serial_mtk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/serial/serial_mtk.c b/drivers/serial/serial_mtk.c
index ded7346a13..2dffa14ea7 100644
--- a/drivers/serial/serial_mtk.c
+++ b/drivers/serial/serial_mtk.c
@@ -439,6 +439,7 @@ static inline void _debug_uart_init(void)
 {
 	struct mtk_serial_priv priv;
 
+	memset(&priv, 0, sizeof(struct mtk_serial_priv));
 	priv.regs = (void *) CONFIG_VAL(DEBUG_UART_BASE);
 	priv.fixed_clk_rate = CONFIG_DEBUG_UART_CLOCK;
 
-- 
2.17.1



More information about the U-Boot mailing list