]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
PCI: iproc: Fix NULL pointer dereference for BCMA
authorRay Jui <ray.jui@broadcom.com>
Thu, 11 Jan 2018 20:36:16 +0000 (12:36 -0800)
committerSeth Forshee <seth.forshee@canonical.com>
Fri, 23 Feb 2018 14:27:23 +0000 (08:27 -0600)
commit9bc8d811e4d5518e7d888afba1a29f4fa6467bda
tree7c2386a5e50364deb3e92f625adbc3caccdc33ee
parent6524723ec384a99ee7a87f0c3c705ced925859c8
PCI: iproc: Fix NULL pointer dereference for BCMA

BugLink: http://bugs.launchpad.net/bugs/1751131
commit 3b65ca50d24ce33cb92d88840e289135c92b40ed upstream.

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+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/pci/host/pcie-iproc-platform.c
drivers/pci/host/pcie-iproc.c
drivers/pci/host/pcie-iproc.h