Commit 2cfa948c authored by Stephen M. Cameron's avatar Stephen M. Cameron Committed by Jens Axboe

cciss: Fix multiple calls to pci_release_regions

Fix multiple calls to pci_release_regions.  If cciss_pci_init
fails, it already does any necessary call to pci_release_regions,
so this does not need to be done again in cciss_init_one in that
case.
Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent c7ebf065
...@@ -4254,7 +4254,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, ...@@ -4254,7 +4254,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
mutex_init(&hba[i]->busy_shutting_down); mutex_init(&hba[i]->busy_shutting_down);
if (cciss_pci_init(hba[i], pdev) != 0) if (cciss_pci_init(hba[i], pdev) != 0)
goto clean0; goto clean_no_release_regions;
sprintf(hba[i]->devname, "cciss%d", i); sprintf(hba[i]->devname, "cciss%d", i);
hba[i]->ctlr = i; hba[i]->ctlr = i;
...@@ -4391,13 +4391,14 @@ clean2: ...@@ -4391,13 +4391,14 @@ clean2:
clean1: clean1:
cciss_destroy_hba_sysfs_entry(hba[i]); cciss_destroy_hba_sysfs_entry(hba[i]);
clean0: clean0:
pci_release_regions(pdev);
clean_no_release_regions:
hba[i]->busy_initializing = 0; hba[i]->busy_initializing = 0;
/* /*
* Deliberately omit pci_disable_device(): it does something nasty to * Deliberately omit pci_disable_device(): it does something nasty to
* Smart Array controllers that pci_enable_device does not undo * Smart Array controllers that pci_enable_device does not undo
*/ */
pci_release_regions(pdev);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
free_hba(i); free_hba(i);
return -1; return -1;
......
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