summaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/wanxl.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-23 05:32:03 +0200
commit4446065a2c9b65398ceb115f4d8c256eb1bb9647 (patch)
treecdaa04d42876632e0df95054d46851cac6648ce3 /drivers/net/wan/wanxl.c
parent[PATCH] WAN: register_hdlc_device() doesn't need dev_alloc_name() (diff)
downloadlinux-4446065a2c9b65398ceb115f4d8c256eb1bb9647.tar.xz
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/wanxl.c')
-rw-r--r--drivers/net/wan/wanxl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
index 29a756dd979b..437e0e938e38 100644
--- a/drivers/net/wan/wanxl.c
+++ b/drivers/net/wan/wanxl.c
@@ -634,7 +634,13 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
/* set up PLX mapping */
plx_phy = pci_resource_start(pdev, 0);
+
card->plx = ioremap_nocache(plx_phy, 0x70);
+ if (!card->plx) {
+ printk(KERN_ERR "wanxl: ioremap() failed\n");
+ wanxl_pci_remove_one(pdev);
+ return -EFAULT;
+ }
#if RESET_WHILE_LOADING
wanxl_reset(card);
@@ -700,6 +706,12 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
}
mem = ioremap_nocache(mem_phy, PDM_OFFSET + sizeof(firmware));
+ if (!mem) {
+ printk(KERN_ERR "wanxl: ioremap() failed\n");
+ wanxl_pci_remove_one(pdev);
+ return -EFAULT;
+ }
+
for (i = 0; i < sizeof(firmware); i += 4)
writel(htonl(*(u32*)(firmware + i)), mem + PDM_OFFSET + i);