From 0fd96bf224c1af7f8fc3bbdc814eba0349d0c334 Mon Sep 17 00:00:00 2001 From: Weijie Gao Date: Wed, 19 Jul 2023 17:16:07 +0800 Subject: [PATCH] serial: mtk: initial priv data before using 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 Signed-off-by: Weijie Gao Reviewed-by: Stefan Roese --- 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.39.5