提交 d9e105ca 编写于 作者: R Robin Murphy 提交者: Greg Kroah-Hartman

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: NRobin Murphy <robin.murphy@arm.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 b18a183e
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册