Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 533ca1fe authored by Dexuan Cui's avatar Dexuan Cui Committed by Lorenzo Pieralisi
Browse files

PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it



The slot must be removed before the pci_dev is removed, otherwise a panic
can happen due to use-after-free.

Fixes: 15becc2b ("PCI: hv: Add hv_pci_remove_slots() when we unload the driver")
Signed-off-by: default avatarDexuan Cui <decui@microsoft.com>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org
parent 5f9e832c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2701,8 +2701,8 @@ static int hv_pci_remove(struct hv_device *hdev)
		/* Remove the bus from PCI's point of view. */
		pci_lock_rescan_remove();
		pci_stop_root_bus(hbus->pci_bus);
		pci_remove_root_bus(hbus->pci_bus);
		hv_pci_remove_slots(hbus);
		pci_remove_root_bus(hbus->pci_bus);
		pci_unlock_rescan_remove();
		hbus->state = hv_pcibus_removed;
	}