[PATCH] PCI: rockchip: Fix bus checks in rockchip_pcie_valid_device()
samuel at dionne-riel.com
Mon Sep 7 13:29:26 EDT 2020
On Mon, 7 Sep 2020 11:20:16 +0100
Lorenzo Pieralisi <lorenzo.pieralisi at arm.com> wrote:
> On Fri, Sep 04, 2020 at 03:09:04PM +0100, Lorenzo Pieralisi wrote:
> > The root bus checks rework in:
> > commit d84c572de1a3 ("PCI: rockchip: Use pci_is_root_bus() to check
> > if bus is root bus")
> > caused a regression whereby in rockchip_pcie_valid_device() if
> > the bus parameter is the root bus and the dev value == 0 the
> > function should return 1 (ie true) without checking if the
> > bus->parent pointer is a root bus because that triggers a NULL
> > pointer dereference.
> > Fix this by streamlining the root bus detection.
> > Fixes: d84c572de1a3 ("PCI: rockchip: Use pci_is_root_bus() to check
> > if bus is root bus") Reported-by: Samuel Dionne-Riel
> > <samuel at dionne-riel.com> Signed-off-by: Lorenzo Pieralisi
> > <lorenzo.pieralisi at arm.com> Cc: Bjorn Helgaas <bhelgaas at google.com>
> > Cc: Rob Herring <robh at kernel.org>
> > Cc: Shawn Lin <shawn.lin at rock-chips.com>
> > ---
> > drivers/pci/controller/pcie-rockchip-host.c | 11 ++++-------
> > 1 file changed, 4 insertions(+), 7 deletions(-)
> Hi Samuel,
> I would kindly ask you please to test it since I changed the code,
> I need your Tested-by before asking Bjorn to merge it.
I'm sorry, I had tested it, but didn't reply back as it worked. Not
being familiar with the customs of the mailing list.
Again, just in case, verified to work and fix the issue on top of
More information about the linux-arm-kernel