serial: tegra: Fix memory leak on DMA setup failure
authorJon Hunter <jonathanh@nvidia.com>
Wed, 20 May 2015 11:21:04 +0000 (12:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 May 2015 19:53:44 +0000 (12:53 -0700)
commit8f8e48f4d6f722a35aac9c990fa54f7bb07b4d5b
tree4b10f5f71da1c5de41e7cc4f51b6ffc2780d59c3
parentc35b49b7166b8054ce33827d5dfd8d6041f5b4df
serial: tegra: Fix memory leak on DMA setup failure

If the call to dmaengine_slave_config() fails, then the DMA buffer will
not be freed/unmapped. Fix this by moving the code that stores the
address of the buffer in the tegra_uart_port structure to before the
call to dmaengine_slave_config().

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