From: Fugang Duan Date: Wed, 17 Jul 2019 05:19:28 +0000 (+0800) Subject: tty: serial: fsl_lpuart: use kzalloc() instead of kmalloc() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ca8d92f6d3ddc24140554c24dcbe0a43759f37d7;p=linux.git 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 --- diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 7bc304798f104..746681be3760e 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;