diff options
author | Ray Jui <ray.jui@broadcom.com> | 2018-01-11 21:36:16 +0100 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2018-01-12 11:40:18 +0100 |
commit | 3b65ca50d24ce33cb92d88840e289135c92b40ed (patch) | |
tree | b2b17d3f2c817ebcf7ac146026b27b69b61f6370 /drivers/pci/host/pcie-iproc.h | |
parent | PCI: dra7xx: Iterate over INTx status bits (diff) | |
download | linux-3b65ca50d24ce33cb92d88840e289135c92b40ed.tar.xz linux-3b65ca50d24ce33cb92d88840e289135c92b40ed.zip |
PCI: iproc: Fix NULL pointer dereference for BCMA
With the inbound DMA mapping supported added, the iProc PCIe driver
parses DT property "dma-ranges" through call to
"of_pci_dma_range_parser_init()". In the case of BCMA, this results in a
NULL pointer deference due to a missing of_node.
Fix this by adding a guard in pcie-iproc-platform.c to only enable the
inbound DMA mapping logic when DT property "dma-ranges" is present.
Fixes: dd9d4e7498de3 ("PCI: iproc: Add inbound DMA mapping support")
Reported-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
[lorenzo.pieralisi@arm.com: updated commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Rafał Miłecki <rafal@milecki.pl>
cc: <stable@vger.kernel.org> # 4.10+
Diffstat (limited to 'drivers/pci/host/pcie-iproc.h')
-rw-r--r-- | drivers/pci/host/pcie-iproc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/host/pcie-iproc.h b/drivers/pci/host/pcie-iproc.h index a6b55cec9a66..4ac6282f2bfd 100644 --- a/drivers/pci/host/pcie-iproc.h +++ b/drivers/pci/host/pcie-iproc.h @@ -74,6 +74,7 @@ struct iproc_msi; * @ob: outbound mapping related parameters * @ob_map: outbound mapping related parameters specific to the controller * + * @need_ib_cfg: indicates SW needs to configure the inbound mapping window * @ib: inbound mapping related parameters * @ib_map: outbound mapping region related parameters * @@ -101,6 +102,7 @@ struct iproc_pcie { struct iproc_pcie_ob ob; const struct iproc_pcie_ob_map *ob_map; + bool need_ib_cfg; struct iproc_pcie_ib ib; const struct iproc_pcie_ib_map *ib_map; |