Skip to content

Commit

Permalink
PCI: iproc: Validate CSR base in BCMA setup code
Browse files Browse the repository at this point in the history
Validate iproc_pcie->base for BCMA devices just like we already do for
platform devices in iproc_pcie_pltfm_probe().  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Bjorn Helgaas committed Oct 12, 2016
1 parent 556c7bb commit f66e5b2
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions drivers/pci/host/pcie-iproc-bcma.c
Original file line number Diff line number Diff line change
@@ -55,6 +55,11 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev)
pcie->dev = dev;

pcie->base = bdev->io_addr;
if (!pcie->base) {
dev_err(dev, "no controller registers\n");
return -ENOMEM;
}

pcie->base_addr = bdev->addr;

res_mem.start = bdev->addr_s[0];
2 changes: 1 addition & 1 deletion drivers/pci/host/pcie-iproc.c
Original file line number Diff line number Diff line change
@@ -462,7 +462,7 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res)
void *sysdata;
struct pci_bus *bus;

if (!pcie || !pcie->dev || !pcie->base)
if (!pcie || !pcie->dev)
return -EINVAL;

dev = pcie->dev;

0 comments on commit f66e5b2

Please sign in to comment.