diff options
author | Dirk Behme <dirk.behme@de.bosch.com> | 2014-12-09 04:11:26 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-09 17:23:07 -0500 |
commit | 2464982174a1886b56b445b0503b331008a626fe (patch) | |
tree | 3d68683da8002103ba4c4d071a3c37c9fcf4fe2f /drivers/tty | |
parent | 7942f8577f2a63b7a6b8cd70f5354a608b30fead (diff) |
serial: imx: unmap sg in case of dmaengine_prep_slave_sg() failure
In case dmaengine_prep_slave_sg() fails, add the missing dma_unmap_sg().
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Anton Bondarenko <anton_bondarenko@mentor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/imx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 5cea7d257426..b4cf24c64a15 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
@@ -558,6 +558,8 @@ static void imx_dma_tx(struct imx_port *sport) | |||
558 | desc = dmaengine_prep_slave_sg(chan, sgl, sport->dma_tx_nents, | 558 | desc = dmaengine_prep_slave_sg(chan, sgl, sport->dma_tx_nents, |
559 | DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT); | 559 | DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT); |
560 | if (!desc) { | 560 | if (!desc) { |
561 | dma_unmap_sg(dev, sgl, sport->dma_tx_nents, | ||
562 | DMA_TO_DEVICE); | ||
561 | dev_err(dev, "We cannot prepare for the TX slave dma!\n"); | 563 | dev_err(dev, "We cannot prepare for the TX slave dma!\n"); |
562 | return; | 564 | return; |
563 | } | 565 | } |
@@ -947,6 +949,7 @@ static int start_rx_dma(struct imx_port *sport) | |||
947 | desc = dmaengine_prep_slave_sg(chan, sgl, 1, DMA_DEV_TO_MEM, | 949 | desc = dmaengine_prep_slave_sg(chan, sgl, 1, DMA_DEV_TO_MEM, |
948 | DMA_PREP_INTERRUPT); | 950 | DMA_PREP_INTERRUPT); |
949 | if (!desc) { | 951 | if (!desc) { |
952 | dma_unmap_sg(dev, sgl, 1, DMA_FROM_DEVICE); | ||
950 | dev_err(dev, "We cannot prepare for the RX slave dma!\n"); | 953 | dev_err(dev, "We cannot prepare for the RX slave dma!\n"); |
951 | return -EINVAL; | 954 | return -EINVAL; |
952 | } | 955 | } |