summaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/n2.c
diff options
context:
space:
mode:
authorKrzysztof Halasa <khc@pm.waw.pl>2006-06-22 22:29:28 +0200
committerJeff Garzik <jeff@garzik.org>2006-06-22 23:32:03 -0400
commit4446065a2c9b65398ceb115f4d8c256eb1bb9647 (patch)
treecdaa04d42876632e0df95054d46851cac6648ce3 /drivers/net/wan/n2.c
parent4a31e348e3ecaf54c50240109ac4574b180f8840 (diff)
downloadlinux-4446065a2c9b65398ceb115f4d8c256eb1bb9647.tar.gz
linux-4446065a2c9b65398ceb115f4d8c256eb1bb9647.tar.bz2
linux-4446065a2c9b65398ceb115f4d8c256eb1bb9647.zip
[PATCH] WAN: ioremap() failure checks in drivers
Eric Sesterhenn found that pci200syn initialization lacks return statement in ioremap() error path (coverity bug id #195). It looks like more WAN drivers have problems with ioremap(). Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/wan/n2.c')
-rw-r--r--drivers/net/wan/n2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c
index cd32751b64eb..b7d88db89a5c 100644
--- a/drivers/net/wan/n2.c
+++ b/drivers/net/wan/n2.c
@@ -387,6 +387,11 @@ static int __init n2_run(unsigned long io, unsigned long irq,
}
card->phy_winbase = winbase;
card->winbase = ioremap(winbase, USE_WINDOWSIZE);
+ if (!card->winbase) {
+ printk(KERN_ERR "n2: ioremap() failed\n");
+ n2_destroy_card(card);
+ return -EFAULT;
+ }
outb(0, io + N2_PCR);
outb(winbase >> 12, io + N2_BAR);