From ca8d92f6d3ddc24140554c24dcbe0a43759f37d7 Mon Sep 17 00:00:00 2001 From: Fugang Duan Date: Wed, 17 Jul 2019 13:19:28 +0800 Subject: [PATCH] tty: serial: fsl_lpuart: use kzalloc() instead of kmalloc() Use kzalloc() instead of kmalloc() to get clean rx buffer that is useful for DMA mode debug to check the data moving validity. Signed-off-by: Fugang Duan Link: https://lore.kernel.org/r/20190717051930.15514-4-fugang.duan@nxp.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/fsl_lpuart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 7bc304798f10..746681be3760 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1097,7 +1097,7 @@ static inline int lpuart_start_rx_dma(struct lpuart_port *sport) if (sport->rx_dma_rng_buf_len < 16) sport->rx_dma_rng_buf_len = 16; - ring->buf = kmalloc(sport->rx_dma_rng_buf_len, GFP_ATOMIC); + ring->buf = kzalloc(sport->rx_dma_rng_buf_len, GFP_ATOMIC); if (!ring->buf) return -ENOMEM;