tty: serial: fsl_lpuart: make coverity happy
Coverity reports the following: var_compare_op: Comparing chan to null implies that chan might be null. 1234 if (chan) 1235 dmaengine_terminate_all(chan); 1236 Dereference after null check (FORWARD_NULL) var_deref_op: Dereferencing null pointer chan. 1237 dma_unmap_sg(chan->device->dev, &sport->rx_sgl, 1, DMA_FROM_DEVICE); Technically, this is correct. But lpuart_dma_rx_free() is guarded by lpuart_dma_rx_use which is only true if there is a dma channel, see lpuart_rx_dma_startup(). In any way, this looks bogus. So remove the superfluous "if (chan)" check and make coverity happy. Fixes: a092ab25 ("tty: serial: fsl_lpuart: fix DMA mapping") Signed-off-by: NMichael Walle <michael@walle.cc> Reported-by: NColin Ian King <colin.king@canonical.com> Acked-by: NJiri Slaby <jslaby@suse.cz> Reviewed-by: NFabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20200403174942.9594-1-michael@walle.ccSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
想要评论请 注册 或 登录