From 8cd47ea19bf8c6f9d3a41b3c312237d007138ae0 Mon Sep 17 00:00:00 2001 From: Kulikov Vasiliy Date: Wed, 21 Jul 2010 02:00:36 +0000 Subject: 3c59x: handle pci_iomap() errors pci_iomap() can fail, handle this case and return -ENOMEM from probe function. Signed-off-by: Kulikov Vasiliy Signed-off-by: David S. Miller --- drivers/net/3c59x.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/net/3c59x.c') 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, 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); -- cgit v1.2.1