linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] serial: 8250_pci: Check mapping in pci_ni8430_init
       [not found] <1231773431.136451.1414716402754.JavaMail.zimbra@xes-inc.com>
@ 2014-10-31  0:49 ` Aaron Sierra
  0 siblings, 0 replies; only message in thread
From: Aaron Sierra @ 2014-10-31  0:49 UTC (permalink / raw)
  To: linux-serial; +Cc: Greg Kroah-Hartman

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

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
---
 drivers/tty/serial/8250/8250_pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 2e8d8a4..e97eeda 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,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-10-31  1:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1231773431.136451.1414716402754.JavaMail.zimbra@xes-inc.com>
2014-10-31  0:49 ` [PATCH 2/2] serial: 8250_pci: Check mapping in pci_ni8430_init Aaron Sierra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).