diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-21 02:00:36 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-22 14:07:36 -0700 |
commit | 8cd47ea19bf8c6f9d3a41b3c312237d007138ae0 (patch) | |
tree | 72eac1187ecd3d633e216e95e6b28704995787ba | |
parent | 963bfeeeec913d135c15dc400f2f86cb62655d81 (diff) |
3c59x: handle pci_iomap() errors
pci_iomap() can fail, handle this case and return -ENOMEM from probe
function.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/3c59x.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 069a03f717d..9b137e14dbb 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c @@ -1020,6 +1020,11 @@ static int __devinit vortex_init_one(struct pci_dev *pdev, ioaddr = pci_iomap(pdev, pci_bar, 0); if (!ioaddr) /* If mapping fails, fall-back to BAR 0... */ ioaddr = pci_iomap(pdev, 0, 0); + if (!ioaddr) { + pci_disable_device(pdev); + rc = -ENOMEM; + goto out; + } rc = vortex_probe1(&pdev->dev, ioaddr, pdev->irq, ent->driver_data, unit); |