diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-20 22:00:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-22 17:07:36 -0400 |
commit | 8cd47ea19bf8c6f9d3a41b3c312237d007138ae0 (patch) | |
tree | 72eac1187ecd3d633e216e95e6b28704995787ba /drivers/net/3c59x.c | |
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>
Diffstat (limited to 'drivers/net/3c59x.c')
-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 069a03f717d3..9b137e14dbb0 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, | |||
1020 | ioaddr = pci_iomap(pdev, pci_bar, 0); | 1020 | ioaddr = pci_iomap(pdev, pci_bar, 0); |
1021 | if (!ioaddr) /* If mapping fails, fall-back to BAR 0... */ | 1021 | if (!ioaddr) /* If mapping fails, fall-back to BAR 0... */ |
1022 | ioaddr = pci_iomap(pdev, 0, 0); | 1022 | ioaddr = pci_iomap(pdev, 0, 0); |
1023 | if (!ioaddr) { | ||
1024 | pci_disable_device(pdev); | ||
1025 | rc = -ENOMEM; | ||
1026 | goto out; | ||
1027 | } | ||
1023 | 1028 | ||
1024 | rc = vortex_probe1(&pdev->dev, ioaddr, pdev->irq, | 1029 | rc = vortex_probe1(&pdev->dev, ioaddr, pdev->irq, |
1025 | ent->driver_data, unit); | 1030 | ent->driver_data, unit); |