diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2010-05-21 11:22:40 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-05-22 04:06:34 -0400 |
commit | 85b8e3ffc47b2a1913be3079e9f1c1f66a6240b2 (patch) | |
tree | 4eb1948eb62060280f5d57030dfb13edae049103 /drivers | |
parent | bb0fe533514c1d480c6c16f8bad070270a73a96c (diff) |
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: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/sh-sci.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 4f73fb756745..5f90fcd7d107 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -1004,8 +1004,9 @@ static void sci_rx_dma_release(struct sci_port *s, bool enable_pio) | |||
1004 | s->chan_rx = NULL; | 1004 | s->chan_rx = NULL; |
1005 | s->cookie_rx[0] = s->cookie_rx[1] = -EINVAL; | 1005 | s->cookie_rx[0] = s->cookie_rx[1] = -EINVAL; |
1006 | dma_release_channel(chan); | 1006 | dma_release_channel(chan); |
1007 | dma_free_coherent(port->dev, s->buf_len_rx * 2, | 1007 | if (sg_dma_address(&s->sg_rx[0])) |
1008 | sg_virt(&s->sg_rx[0]), sg_dma_address(&s->sg_rx[0])); | 1008 | dma_free_coherent(port->dev, s->buf_len_rx * 2, |
1009 | sg_virt(&s->sg_rx[0]), sg_dma_address(&s->sg_rx[0])); | ||
1009 | if (enable_pio) | 1010 | if (enable_pio) |
1010 | sci_start_rx(port); | 1011 | sci_start_rx(port); |
1011 | } | 1012 | } |