pch_uart: Fix duplicate memory release issue

Add initialize variable to prevent duplicate free memory.

Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Tomoya MORINAGA 2012-03-26 14:43:06 +09:00 committed by Greg Kroah-Hartman
parent 04e2c2e3bf
commit ef4f9d4f09
1 changed files with 7 additions and 4 deletions

View File

@ -656,10 +656,13 @@ static void pch_free_dma(struct uart_port *port)
dma_release_channel(priv->chan_rx);
priv->chan_rx = NULL;
}
if (sg_dma_address(&priv->sg_rx))
dma_free_coherent(port->dev, port->fifosize,
sg_virt(&priv->sg_rx),
sg_dma_address(&priv->sg_rx));
if (priv->rx_buf_dma) {
dma_free_coherent(port->dev, port->fifosize, priv->rx_buf_virt,
priv->rx_buf_dma);
priv->rx_buf_virt = NULL;
priv->rx_buf_dma = 0;
}
return;
}