Skip to content

Commit 5d14bba

Browse files
Aaron Sierragregkh
authored andcommitted
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 <asierra@xes-inc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 398a9db commit 5d14bba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/tty/serial/8250/8250_pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,8 @@ pci_ni8430_setup(struct serial_private *priv,
757757
offset += idx * board->uart_offset;
758758

759759
p = pci_ioremap_bar(dev, bar);
760+
if (!p)
761+
return -ENOMEM;
760762

761763
/* enable the transceiver */
762764
writeb(readb(p + offset + NI8430_PORTCON) | NI8430_PORTCON_TXVR_ENABLE,

0 commit comments

Comments
 (0)