]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitafb6d01e5055b353a9a578f6b821c1062c76fa38
tree4b10f5f71da1c5de41e7cc4f51b6ffc2780d59c3
parentcc2a813715e7dc2c6d96d14604d25e6b10b95321
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