A PCI device may be detached from /proc/bus/pci/devices not only when it is removed, but also when its bus had changed the number - in this case the proc entry must be recreated to reflect the new PCI topology. Nullify freed pointers to mark them as valid for allocating again. Signed-off-by: Sergey Miroshnichenko <s.miroshnichenko@xxxxxxxxx> --- drivers/pci/proc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 5495537c60c2..c85654dd315b 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -443,6 +443,7 @@ int pci_proc_detach_device(struct pci_dev *dev) int pci_proc_detach_bus(struct pci_bus *bus) { proc_remove(bus->procdir); + bus->procdir = NULL; return 0; } -- 2.23.0