diff mbox

pci: only release that resource index is less than 3

Message ID 4AE2C827.8040905@kernel.org (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Yinghai Lu Oct. 24, 2009, 9:25 a.m. UTC
None
diff mbox

Patch

Index: linux-2.6/drivers/pci/setup-bus.c
===================================================================
--- linux-2.6.orig/drivers/pci/setup-bus.c
+++ linux-2.6/drivers/pci/setup-bus.c
@@ -344,9 +344,14 @@  static struct resource *find_free_bus_re
 			 * if there is no child under that, we should release
 			 * and use it. don't need to reset it, pbus_size_* will
 			 * set it again
+			 * need to be less 3, otherwise can not write it to
+			 * bridge, also need to avoid releasing it from
+			 * transparent bus path
 			 */
-			if (!r->child && !release_resource(r))
-				return r;
+			if (i < 3 && !r->child) {
+				if (!release_resource(r))
+					return r;
+			}
 		}
 	}
 	return NULL;