diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2020-12-16 00:11:07 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2020-12-16 00:11:07 +0300 |
commit | 1a76dceaf4268f904292ca126d1cb9af091fd516 (patch) | |
tree | e98e8b189cfd2bf460f469de276977c141a7899d /drivers/pci/slot.c | |
parent | 6a94785fb9f8dd3c76f32b7a029691ab3fc884c5 (diff) | |
parent | 4684709bf81a2d98152ed6b610e3d5c403f9bced (diff) | |
download | linux-1a76dceaf4268f904292ca126d1cb9af091fd516.tar.xz |
Merge branch 'pci/hotplug'
- Remove unneeded break in ibmphp (Bjorn Helgaas)
- Fix pci_slot_release() NULL pointer dereference (Jubin Zhong)
* pci/hotplug:
PCI: Fix pci_slot_release() NULL pointer dereference
PCI: ibmphp: Remove unneeded break
Diffstat (limited to 'drivers/pci/slot.c')
-rw-r--r-- | drivers/pci/slot.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c index 3861505741e6..ed2077e7470a 100644 --- a/drivers/pci/slot.c +++ b/drivers/pci/slot.c @@ -272,6 +272,9 @@ placeholder: goto err; } + INIT_LIST_HEAD(&slot->list); + list_add(&slot->list, &parent->slots); + err = kobject_init_and_add(&slot->kobj, &pci_slot_ktype, NULL, "%s", slot_name); if (err) { @@ -279,9 +282,6 @@ placeholder: goto err; } - INIT_LIST_HEAD(&slot->list); - list_add(&slot->list, &parent->slots); - down_read(&pci_bus_sem); list_for_each_entry(dev, &parent->devices, bus_list) if (PCI_SLOT(dev->devfn) == slot_nr) |