On Fri, Sep 4, 2020 at 8:09 AM Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx> 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@xxxxxxxxxxxxxxx> > Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx> > Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> > Cc: Rob Herring <robh@xxxxxxxxxx> > Cc: Shawn Lin <shawn.lin@xxxxxxxxxxxxxx> > --- > drivers/pci/controller/pcie-rockchip-host.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) Even better than my broken version. Reviewed-by: Rob Herring <robh@xxxxxxxxxx>