Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 335

kernel-2.6.18-238.el5.src.rpm

From: Tomas Henzl <thenzl@redhat.com>
Date: Sun, 29 Aug 2010 15:49:34 -0400
Subject: [block] cciss: no pci_release_regions on regions not held
Message-id: <1283097002-3341-36-git-send-email-thenzl@redhat.com>
Patchwork-id: 27893
O-Subject: [RHEL6 PATCH 35/63] cciss: do not call pci_release_regions for
	regions not held.
Bugzilla: 568830
RH-Acked-by: Neil Horman <nhorman@redhat.com>

do not call pci_release_regions for regions not held.
If cciss_pci_init fails, it will never leave pci regions claimed,
so do not call pci_release_regions in cciss_init_one in the case which
cciss_pci_init fails.

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index d2793c1..981931e 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -4180,7 +4180,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
 	INIT_HLIST_HEAD(&hba[i]->reqQ);
 
 	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;
@@ -4322,6 +4322,8 @@ clean4:
       clean0:
 	hba[i]->busy_initializing = 0;
 	pci_release_regions(pdev);
+clean_no_release_regions:
+	hba[i]->busy_initializing = 0;
 	/* This call to pci_disable_device causes the driver to be unable
 	 * to load/unload multiple times.  No reason why yet, but we are
 	 * leaving it out for now.