]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
serial: mtk: initial priv data before using
authorWeijie Gao <weijie.gao@mediatek.com>
Wed, 19 Jul 2023 09:16:07 +0000 (17:16 +0800)
committerTom Rini <trini@konsulko.com>
Thu, 3 Aug 2023 13:40:49 +0000 (09:40 -0400)
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@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/serial/serial_mtk.c

index ded7346a13f560c3fcd7703e3e773fb11b36c4eb..2dffa14ea7577a4d460a8c642214239360c86f5b 100644 (file)
@@ -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;