Commit 41cbea2b authored by Yuriy Kozlov's avatar Yuriy Kozlov Committed by Greg Kroah-Hartman

tty: serial: altera_uart: Check for NULL platform_data in probe.

commit acede70d upstream.

Follow altera_jtag_uart.  This fixes a crash if there is a mistake in the DTS.
Signed-off-by: default avatarYuriy Kozlov <ykozlov@ptcusa.com>
Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c48fca49
......@@ -555,7 +555,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res_mem)
port->mapbase = res_mem->start;
else if (platp->mapbase)
else if (platp)
port->mapbase = platp->mapbase;
else
return -EINVAL;
......@@ -563,7 +563,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res_irq)
port->irq = res_irq->start;
else if (platp->irq)
else if (platp)
port->irq = platp->irq;
/* Check platform data first so we can override device node data */
......
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