aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/wanxl.c
diff options
context:
space:
mode:
authorKrzysztof Halasa <khc@pm.waw.pl>2006-06-22 16:29:28 -0400
committerJeff Garzik <jeff@garzik.org>2006-06-22 23:32:03 -0400
commit4446065a2c9b65398ceb115f4d8c256eb1bb9647 (patch)
treecdaa04d42876632e0df95054d46851cac6648ce3 /drivers/net/wan/wanxl.c
parent4a31e348e3ecaf54c50240109ac4574b180f8840 (diff)
[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,
634 634
635 /* set up PLX mapping */ 635 /* set up PLX mapping */
636 plx_phy = pci_resource_start(pdev, 0); 636 plx_phy = pci_resource_start(pdev, 0);
637
637 card->plx = ioremap_nocache(plx_phy, 0x70); 638 card->plx = ioremap_nocache(plx_phy, 0x70);
639 if (!card->plx) {
640 printk(KERN_ERR "wanxl: ioremap() failed\n");
641 wanxl_pci_remove_one(pdev);
642 return -EFAULT;
643 }
638 644
639#if RESET_WHILE_LOADING 645#if RESET_WHILE_LOADING
640 wanxl_reset(card); 646 wanxl_reset(card);
@@ -700,6 +706,12 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
700 } 706 }
701 707
702 mem = ioremap_nocache(mem_phy, PDM_OFFSET + sizeof(firmware)); 708 mem = ioremap_nocache(mem_phy, PDM_OFFSET + sizeof(firmware));
709 if (!mem) {
710 printk(KERN_ERR "wanxl: ioremap() failed\n");
711 wanxl_pci_remove_one(pdev);
712 return -EFAULT;
713 }
714
703 for (i = 0; i < sizeof(firmware); i += 4) 715 for (i = 0; i < sizeof(firmware); i += 4)
704 writel(htonl(*(u32*)(firmware + i)), mem + PDM_OFFSET + i); 716 writel(htonl(*(u32*)(firmware + i)), mem + PDM_OFFSET + i);
705 717