Merge tag 'pci-v4.13-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 14 Jul 2017 19:36:20 +0000 (12:36 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 14 Jul 2017 19:36:20 +0000 (12:36 -0700)
Pull PCI fixes from Bjorn Helgaas:

 - fix a typo that broke Rockchip enumeration

 - fix a new memory leak in the ARM host bridge failure path

* tag 'pci-v4.13-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  PCI: rockchip: Check for pci_scan_root_bus_bridge() failure correctly
  ARM/PCI: Fix pcibios_init_resource() struct pci_host_bridge leak

arch/arm/kernel/bios32.c
drivers/pci/host/pcie-rockchip.c

index 56dc1a3a33b4347867a05341cbb35cd5ff9c2e99..c1809fb549ddde428f8bec226c4c7106b89ab240 100644 (file)
@@ -480,7 +480,7 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
 
                        ret = pcibios_init_resource(nr, sys, hw->io_optional);
                        if (ret)  {
-                               kfree(sys);
+                               pci_free_host_bridge(bridge);
                                break;
                        }
 
index 5acf8694fb23bc41d6000c27ae43c425fe478f8a..7bb9870f6d8ce0bd001529ef4c8dba1659e624a1 100644 (file)
@@ -1483,7 +1483,7 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
        bridge->swizzle_irq = pci_common_swizzle;
 
        err = pci_scan_root_bus_bridge(bridge);
-       if (!err)
+       if (err < 0)
                goto err_free_res;
 
        bus = bridge->bus;