Commit 1025744a authored by Lior Dotan's avatar Lior Dotan Committed by Greg Kroah-Hartman

Staging: SLICOSS: free resources on entry_probe error path

Call pci_disable_device() and free_netdev() if slic_entry_probe fails.

Signed_off-by: Lior Dotan <liodot@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a390c479
...@@ -335,7 +335,7 @@ static int __devinit slic_entry_probe(struct pci_dev *pcidev, ...@@ -335,7 +335,7 @@ static int __devinit slic_entry_probe(struct pci_dev *pcidev,
{ {
static int cards_found; static int cards_found;
static int did_version; static int did_version;
int err; int err = -ENODEV;
struct net_device *netdev; struct net_device *netdev;
struct adapter *adapter; struct adapter *adapter;
void __iomem *memmapped_ioaddr = NULL; void __iomem *memmapped_ioaddr = NULL;
...@@ -369,7 +369,7 @@ static int __devinit slic_entry_probe(struct pci_dev *pcidev, ...@@ -369,7 +369,7 @@ static int __devinit slic_entry_probe(struct pci_dev *pcidev,
DBG_MSG DBG_MSG
("No usable DMA configuration, aborting err[%x]\n", ("No usable DMA configuration, aborting err[%x]\n",
err); err);
return err; goto err_out_disable_pci;
} }
DBG_MSG("pci_set_dma_mask(DMA_32BIT_MASK) successful\n"); DBG_MSG("pci_set_dma_mask(DMA_32BIT_MASK) successful\n");
} }
...@@ -379,7 +379,7 @@ static int __devinit slic_entry_probe(struct pci_dev *pcidev, ...@@ -379,7 +379,7 @@ static int __devinit slic_entry_probe(struct pci_dev *pcidev,
err = pci_request_regions(pcidev, DRV_NAME); err = pci_request_regions(pcidev, DRV_NAME);
if (err) { if (err) {
DBG_MSG("pci_request_regions FAILED err[%x]\n", err); DBG_MSG("pci_request_regions FAILED err[%x]\n", err);
return err; goto err_out_disable_pci;
} }
DBG_MSG("call pci_set_master\n"); DBG_MSG("call pci_set_master\n");
...@@ -413,7 +413,7 @@ static int __devinit slic_entry_probe(struct pci_dev *pcidev, ...@@ -413,7 +413,7 @@ static int __devinit slic_entry_probe(struct pci_dev *pcidev,
if (!memmapped_ioaddr) { if (!memmapped_ioaddr) {
DBG_ERROR("%s cannot remap MMIO region %lx @ %lx\n", DBG_ERROR("%s cannot remap MMIO region %lx @ %lx\n",
__func__, mmio_len, mmio_start); __func__, mmio_len, mmio_start);
goto err_out_free_mmio_region; goto err_out_free_netdev;
} }
DBG_MSG DBG_MSG
...@@ -497,16 +497,17 @@ static int __devinit slic_entry_probe(struct pci_dev *pcidev, ...@@ -497,16 +497,17 @@ static int __devinit slic_entry_probe(struct pci_dev *pcidev,
err_out_unmap: err_out_unmap:
iounmap(memmapped_ioaddr); iounmap(memmapped_ioaddr);
err_out_free_mmio_region: err_out_free_mmio_region:
release_mem_region(mmio_start, mmio_len); release_mem_region(mmio_start, mmio_len);
err_out_free_netdev:
free_netdev(netdev);
err_out_exit_slic_probe: err_out_exit_slic_probe:
pci_release_regions(pcidev); pci_release_regions(pcidev);
DBG_ERROR("%s EXIT jiffies[%lx] cpu %d\n", __func__, jiffies, DBG_ERROR("%s EXIT jiffies[%lx] cpu %d\n", __func__, jiffies,
smp_processor_id()); smp_processor_id());
err_out_disable_pci:
return -ENODEV; pci_disable_device(pcidev);
return err;
} }
static int slic_entry_open(struct net_device *dev) static int slic_entry_open(struct net_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment