提交 ef4f9d4f 编写于 作者: T Tomoya MORINAGA 提交者: Greg Kroah-Hartman

pch_uart: Fix duplicate memory release issue

Add initialize variable to prevent duplicate free memory.
Signed-off-by: NTomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 04e2c2e3
无相关合并请求
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部