Commit ef4f9d4f authored by Tomoya MORINAGA's avatar Tomoya MORINAGA Committed by Greg Kroah-Hartman

pch_uart: Fix duplicate memory release issue

Add initialize variable to prevent duplicate free memory.
Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 04e2c2e3
...@@ -656,10 +656,13 @@ static void pch_free_dma(struct uart_port *port) ...@@ -656,10 +656,13 @@ static void pch_free_dma(struct uart_port *port)
dma_release_channel(priv->chan_rx); dma_release_channel(priv->chan_rx);
priv->chan_rx = NULL; priv->chan_rx = NULL;
} }
if (sg_dma_address(&priv->sg_rx))
dma_free_coherent(port->dev, port->fifosize, if (priv->rx_buf_dma) {
sg_virt(&priv->sg_rx), dma_free_coherent(port->dev, port->fifosize, priv->rx_buf_virt,
sg_dma_address(&priv->sg_rx)); priv->rx_buf_dma);
priv->rx_buf_virt = NULL;
priv->rx_buf_dma = 0;
}
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment