projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4f03d5
)
MLK-11851 tty: series: imx: add dma memory check before freeing
author
Fugang Duan
<b38611@freescale.com>
Wed, 11 Nov 2015 01:31:04 +0000
(09:31 +0800)
committer
Nitin Garg
<nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:21:39 +0000
(15:21 -0500)
Add dma memory check before free it.
Signed-off-by: Fugang Duan <B38611@freescale.com>
drivers/tty/serial/imx.c
patch
|
blob
|
history
diff --git
a/drivers/tty/serial/imx.c
b/drivers/tty/serial/imx.c
index
ebfd0c0
..
3ed0a88
100644
(file)
--- a/
drivers/tty/serial/imx.c
+++ b/
drivers/tty/serial/imx.c
@@
-1103,10
+1103,12
@@
static void imx_uart_dma_exit(struct imx_port *sport)
dma_release_channel(sport->dma_chan_rx);
sport->dma_chan_rx = NULL;
- dma_free_coherent(NULL, IMX_RXBD_NUM * RX_BUF_SIZE,
- (void *)sport->rx_buf.buf,
- sport->rx_buf.dmaaddr);
- sport->rx_buf.buf = NULL;
+ if (sport->rx_buf.buf) {
+ dma_free_coherent(NULL, IMX_RXBD_NUM * RX_BUF_SIZE,
+ (void *)sport->rx_buf.buf,
+ sport->rx_buf.dmaaddr);
+ sport->rx_buf.buf = NULL;
+ }
}
if (sport->dma_chan_tx) {