From: Aaron Sierra Date: Fri, 31 Oct 2014 00:49:52 +0000 (-0500) Subject: serial: 8250_pci: Check mapping in pci_ni8430_init X-Git-Tag: firefly_0821_release~176^2~2678^2~81 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5d14bba91d8c350b21d28834fab95f67a46a264e;p=firefly-linux-kernel-4.4.55.git serial: 8250_pci: Check mapping in pci_ni8430_init Check the return value of ioremap_nocache to make sure we got a valid mapping. Signed-off-by: Aaron Sierra Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 50f75703fd54..003679fc884b 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -757,6 +757,8 @@ pci_ni8430_setup(struct serial_private *priv, offset += idx * board->uart_offset; p = pci_ioremap_bar(dev, bar); + if (!p) + return -ENOMEM; /* enable the transceiver */ writeb(readb(p + offset + NI8430_PORTCON) | NI8430_PORTCON_TXVR_ENABLE,