Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1285971

[PATCHv6 2/7] pci: child bus alloc fix on constrained resource

From Keith Busch <keith.busch@intel.com>
Newsgroups linux.kernel
Subject [PATCHv6 2/7] pci: child bus alloc fix on constrained resource
Date 2015-12-07 22:40 +0100
Message-ID <qDbFN-1D6-41@gated-at.bofh.it> (permalink)
References <qDbFL-1D6-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Does not allocate a child bus if the new bus number does not fit in the
parent's bus resource window.

Signed-off-by: Keith Busch <keith.busch@intel.com>
---
 drivers/pci/probe.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index edb1984..6e29f7a 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -704,6 +704,12 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent,
 	int i;
 	int ret;
 
+	if (busnr > parent->busn_res.end) {
+		dev_printk(KERN_DEBUG, &parent->dev,
+			  "can not alloc bus:%d under %pR\n", busnr,
+			  &parent->busn_res);
+		return NULL;
+	}
 	/*
 	 * Allocate a new bus, and inherit stuff from the parent..
 	 */
-- 
2.6.2.307.g37023ba

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv6 0/7] Driver for new "VMD" device Keith Busch <keith.busch@intel.com> - 2015-12-07 22:40 +0100
  [PATCHv5 7/7] pciutils: Allow 32-bit domains Keith Busch <keith.busch@intel.com> - 2015-12-07 22:40 +0100
  [PATCHv6 5/7] x86/pci: Initial commit for new VMD device driver Keith Busch <keith.busch@intel.com> - 2015-12-07 22:40 +0100
  [PATCHv6 4/7] x86-pci: allow pci domain specific dma ops Keith Busch <keith.busch@intel.com> - 2015-12-07 22:40 +0100
  [PATCHv6 2/7] pci: child bus alloc fix on constrained resource Keith Busch <keith.busch@intel.com> - 2015-12-07 22:40 +0100
  [PATCHv6 6/7] aer_inject: Use 32 bit int type domains Keith Busch <keith.busch@intel.com> - 2015-12-07 22:40 +0100
  [PATCHv6 3/7] Export msi and irq functions for module use Keith Busch <keith.busch@intel.com> - 2015-12-07 22:40 +0100
  Re: [PATCHv6 0/7] Driver for new "VMD" device Thomas Gleixner <tglx@linutronix.de> - 2015-12-08 13:20 +0100

csiph-web