Commit 85b8e3ff authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Paul Mundt

sh: fix Oops in the serial SCI driver

Fix an Oops, triggering, if the DMA buffer allocation for the Rx channel in
sh-sci.c fails.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent bb0fe533
......@@ -1004,6 +1004,7 @@ static void sci_rx_dma_release(struct sci_port *s, bool enable_pio)
s->chan_rx = NULL;
s->cookie_rx[0] = s->cookie_rx[1] = -EINVAL;
dma_release_channel(chan);
if (sg_dma_address(&s->sg_rx[0]))
dma_free_coherent(port->dev, s->buf_len_rx * 2,
sg_virt(&s->sg_rx[0]), sg_dma_address(&s->sg_rx[0]));
if (enable_pio)
......
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