diff options
author | Krzysztof Halasa <khc@pm.waw.pl> | 2006-06-22 22:29:28 +0200 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-06-22 23:32:03 -0400 |
commit | 4446065a2c9b65398ceb115f4d8c256eb1bb9647 (patch) | |
tree | cdaa04d42876632e0df95054d46851cac6648ce3 /drivers/net/wan/wanxl.c | |
parent | 4a31e348e3ecaf54c50240109ac4574b180f8840 (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.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 29a756dd979..437e0e938e3 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); |