diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2013-12-04 14:52:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-08 20:16:05 -0500 |
commit | e41c0981213f39ecd421d8c1f7334cf04c2122e3 (patch) | |
tree | c29c189f59e04cd6ca0d2c5a9df8c5554c1287ec | |
parent | 0da3336f19f2a42e9153efa4112d50fd148a8e61 (diff) |
tty: serial: pch: don't crash if DMA enabled but not loaded
if the DMA driver isn't loaded "on time" then we crash in the irq handler:
| pch_uart 0000:02:0a.4: pch_request_dma:dma_request_channel FAILS(Tx)
| BUG: unable to handle kernel NULL pointer dereference at (null)
| IP: [<c0676ed9>] pch_uart_interrupt+0x739/0x940
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/pch_uart.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index 0aa2b528ef3d..6bb7e90c8f22 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c | |||
@@ -1508,10 +1508,14 @@ static int pch_uart_verify_port(struct uart_port *port, | |||
1508 | __func__); | 1508 | __func__); |
1509 | return -EOPNOTSUPP; | 1509 | return -EOPNOTSUPP; |
1510 | #endif | 1510 | #endif |
1511 | dev_info(priv->port.dev, "PCH UART : Use DMA Mode\n"); | 1511 | if (!priv->use_dma) { |
1512 | if (!priv->use_dma) | ||
1513 | pch_request_dma(port); | 1512 | pch_request_dma(port); |
1514 | priv->use_dma = 1; | 1513 | if (priv->chan_rx) |
1514 | priv->use_dma = 1; | ||
1515 | } | ||
1516 | dev_info(priv->port.dev, "PCH UART: %s\n", | ||
1517 | priv->use_dma ? | ||
1518 | "Use DMA Mode" : "No DMA"); | ||
1515 | } | 1519 | } |
1516 | 1520 | ||
1517 | return 0; | 1521 | return 0; |