diff options
author | Robin Murphy <robin.murphy@arm.com> | 2016-03-03 17:35:35 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-08 01:11:14 +0100 |
commit | d9e105ca601e58feec65cdcef86d9c5748b7e5bb (patch) | |
tree | 93fb2a76912190cf0d8ac90bd3e4eedcdcde0f58 /drivers/tty | |
parent | tty: serial: Use GFP_ATOMIC instead of GFP_KERNEL in serial8250_em485_init() (diff) | |
download | linux-d9e105ca601e58feec65cdcef86d9c5748b7e5bb.tar.xz linux-d9e105ca601e58feec65cdcef86d9c5748b7e5bb.zip |
tty: amba-pl011: don't dereference NULL platform data
When only a TX DMA channel is specified in DT, pl011_dma_probe() falls
back to looking for the optional RX channel in platform data. What it
doesn't do is check whether that platform data actually exists...
Add the missing check to avoid crashing the kernel.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 500232ad38f3..3f169275f9fa 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -420,7 +420,7 @@ static void pl011_dma_probe(struct uart_amba_port *uap) /* Optionally make use of an RX channel as well */ chan = dma_request_slave_channel(dev, "rx"); - if (!chan && plat->dma_rx_param) { + if (!chan && plat && plat->dma_rx_param) { chan = dma_request_channel(mask, plat->dma_filter, plat->dma_rx_param); if (!chan) { |