From: Weijie Gao Date: Wed, 19 Jul 2023 09:16:07 +0000 (+0800) Subject: serial: mtk: initial priv data before using X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=0fd96bf224c1af7f8fc3bbdc814eba0349d0c334;p=u-boot.git 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 --- 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;