Skip to content

Commit

Permalink
cciss: Fix multiple calls to pci_release_regions
Browse files Browse the repository at this point in the history
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: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Stephen M. Cameron authored and Jens Axboe committed Oct 13, 2009
1 parent c7ebf06 commit 2cfa948
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -4254,7 +4254,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
mutex_init(&hba[i]->busy_shutting_down);

if (cciss_pci_init(hba[i], pdev) != 0)
goto clean0;
goto clean_no_release_regions;

sprintf(hba[i]->devname, "cciss%d", i);
hba[i]->ctlr = i;
Expand Down Expand Up @@ -4391,13 +4391,14 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
clean1:
cciss_destroy_hba_sysfs_entry(hba[i]);
clean0:
pci_release_regions(pdev);
clean_no_release_regions:
hba[i]->busy_initializing = 0;

/*
* Deliberately omit pci_disable_device(): it does something nasty to
* Smart Array controllers that pci_enable_device does not undo
*/
pci_release_regions(pdev);
pci_set_drvdata(pdev, NULL);
free_hba(i);
return -1;
Expand Down

0 comments on commit 2cfa948

Please sign in to comment.