linux_dsm_epyc7002/drivers/pci/host
Geert Uytterhoeven 0c31f1d7be PCI: rcar: Fix use-after-free in probe error path
If CONFIG_DEBUG_SLAB=y, and no PCIe card is inserted, the kernel crashes
during probe on r8a7791/koelsch:

  rcar-pcie fe000000.pcie: PCIe link down
  Unable to handle kernel paging request at virtual address 6b6b6b6b

(seeing this message requires earlycon and keep_bootcon).

Indeed, pci_free_host_bridge() frees the PCI host bridge, including the
embedded rcar_pcie object, so pci_free_resource_list() must not be called
afterwards.

To fix this, move the call to pci_free_resource_list() up, and update the
label name accordingly.

Fixes: ddd535f1ea ("PCI: rcar: Fix memory leak when no PCIe card is inserted")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2017-12-12 11:01:47 -06:00
..
Kconfig PCI: v3-semi: Add V3 Semiconductor PCI host driver 2017-10-05 15:52:55 -05:00
Makefile pci-v4.15-changes 2017-11-15 15:01:28 -08:00
pci-aardvark.c PCI: aardvark: Move to struct pci_host_bridge IRQ mapping functions 2017-10-10 21:17:43 -05:00
pci-ftpci100.c pci-v4.15-changes 2017-11-15 15:01:28 -08:00
pci-host-common.c PCI: generic: Drop pci_fixup_irqs() 2017-07-02 16:51:19 -05:00
pci-host-generic.c PCI: generic: Add support for Synopsys DesignWare RC in ECAM mode 2017-10-06 17:46:26 -05:00
pci-hyperv.c PCI: hv: Use effective affinity mask 2017-11-07 18:06:39 -06:00
pci-mvebu.c Merge branch 'pci/misc' into next 2017-09-07 13:24:16 -05:00
pci-rcar-gen2.c PCI: Use of_pci_dma_range_parser_init() to reduce duplication 2017-10-05 15:52:34 -05:00
pci-tegra.c pci-v4.15-changes 2017-11-15 15:01:28 -08:00
pci-thunder-ecam.c PCI: Don't allow unbinding host controllers that aren't prepared 2017-04-28 10:38:00 -05:00
pci-thunder-pem.c PCI: Don't allow unbinding host controllers that aren't prepared 2017-04-28 10:38:00 -05:00
pci-v3-semi.c PCI: v3-semi: Add V3 Semiconductor PCI host driver 2017-10-05 15:52:55 -05:00
pci-versatile.c PCI: versatile: Add local struct device pointers 2017-07-02 18:46:43 -05:00
pci-xgene-msi.c PCI: xgene: Fix platform_get_irq() error handling 2017-09-07 08:52:42 -05:00
pci-xgene.c Merge branch 'pci/host-xgene' into next 2017-11-14 12:11:37 -06:00
pcie-altera-msi.c PCI: altera: Fix platform_get_irq() error handling 2017-09-05 13:36:28 -05:00
pcie-altera.c PCI: altera: Rename altera_pcie_link_is_up() to altera_pcie_link_up() 2017-11-09 16:17:39 -06:00
pcie-iproc-bcma.c PCI: iproc: Convert PCI scan API to pci_scan_root_bus_bridge() 2017-07-02 16:14:24 -05:00
pcie-iproc-msi.c PCI: iproc: Allow allocation of multiple MSIs 2017-10-17 14:00:25 -05:00
pcie-iproc-platform.c PCI: iproc: Add 500ms delay during device shutdown 2017-09-05 12:27:03 -05:00
pcie-iproc.c PCI: Use of_pci_dma_range_parser_init() to reduce duplication 2017-10-05 15:52:34 -05:00
pcie-iproc.h PCI: iproc: Add 500ms delay during device shutdown 2017-09-05 12:27:03 -05:00
pcie-mediatek.c PCI: mediatek: Use PCI_NUM_INTX 2017-08-30 08:23:59 -05:00
pcie-rcar.c PCI: rcar: Fix use-after-free in probe error path 2017-12-12 11:01:47 -06:00
pcie-rockchip.c Merge branch 'pci/trivial' into next 2017-09-07 13:24:20 -05:00
pcie-tango.c pci-v4.15-changes 2017-11-15 15:01:28 -08:00
pcie-xilinx-nwl.c PCI: xilinx-nwl: Fix platform_get_irq() error handling 2017-09-05 13:41:13 -05:00
pcie-xilinx.c PCI: xilinx: Rename xilinx_pcie_link_is_up() to xilinx_pcie_link_up() 2017-11-09 16:19:47 -06:00
vmd.c PCI: vmd: Remove IRQ affinity so we can allocate more IRQs 2017-08-30 16:18:38 -05:00