From: Ezequiel Garcia Date: Fri, 26 Jul 2013 13:17:49 +0000 (-0300) Subject: PCI: mvebu: Check valid base address before port setup X-Git-Tag: upstream/snapshot3+hdmi~4405^2~15^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b22503a9c3bd8a3512fa4daf2c6c456d12db34de;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git PCI: mvebu: Check valid base address before port setup This driver does not fail to probe when it cannot obtain a port base address. Therefore, add a check for NULL base address before setting up the port, which prevents a kernel panic in such cases. Signed-off-by: Ezequiel Garcia Tested-by: Andrew Lunn Tested-by: Sebastian Hesselbarth Signed-off-by: Jason Cooper --- diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index 424a7b8..338691b 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c @@ -662,6 +662,8 @@ static int __init mvebu_pcie_setup(int nr, struct pci_sys_data *sys) for (i = 0; i < pcie->nports; i++) { struct mvebu_pcie_port *port = &pcie->ports[i]; + if (!port->base) + continue; mvebu_pcie_setup_hw(port); }