Skip to contentSkip to conversation

serial: 8250_pci: Check mapping in pci_ni8430_init

PATCH New Aaron Sierra 1 participant 1 message Oct 31, 2014 1 message not in the archive TTY layer and serial drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/2 serial: 8250_pci: Check mapping in pci_ni8430_init

Check the return value of ioremap_nocache to make sure we got a valid mapping.

---
 drivers/tty/serial/8250/8250_pci.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/tty/serial/8250/8250_pci.c +2 -0
index 2e8d8a4..e97eeda 100644
@@ -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,
Signature · 1 line
1.9.1