serial: tegra: Correct error handling on DMA setup
authorJon Hunter <jonathanh@nvidia.com>
Tue, 5 May 2015 14:17:59 +0000 (15:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2015 17:12:19 +0000 (19:12 +0200)
commitad909b3f8b162a61ce9e32726dadb380e51f8949
tree4451c62fde6d0ca954d6d329fbe63468fc55abeb
parentd92aca3a76662d2da8fe843ab124c45b47ea127d
serial: tegra: Correct error handling on DMA setup

Function tegra_uart_dma_channel_allocate() does not check that
dma_map_single() mapped the DMA buffer correctly. Add a check for this
and appropriate error handling.

Furthermore, if dmaengine_slave_config() (called by
tegra_uart_dma_channel_allocate()) fails, then memory allocated/mapped
is not freed/unmapped. Therefore, call tegra_uart_dma_channel_free()
instead of just dma_release_channel() if  dmaengine_slave_config() fails.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial-tegra.c