mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 11:19:37 +00:00
tty: serial: altera_uart: Check for NULL platform_data in probe.
Follow altera_jtag_uart. This fixes a crash if there is a mistake in the DTS. Signed-off-by: Yuriy Kozlov <ykozlov@ptcusa.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ef37ea34ca
commit
acede70d65
1 changed files with 2 additions and 2 deletions
|
@ -556,7 +556,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;
|
||||
|
@ -564,7 +564,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 */
|
||||
|
|
Loading…
Reference in a new issue