diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2017-12-07 11:15:19 +0100 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-12-12 11:01:47 -0600 |
commit | 0c31f1d7be1b5c4858b1d714dcefa25f41428cab (patch) | |
tree | e39aee603c3c12ad4600cec69431e0e4ab5f7746 /arch/x86/pci | |
parent | a19e2696135efb471981c1ae1ec3cb2b70c41a2e (diff) |
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: ddd535f1ea3eb27e ("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>
Diffstat (limited to 'arch/x86/pci')
0 files changed, 0 insertions, 0 deletions