diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/cpci_hotplug_core.c | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpci_hotplug_pci.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index 8132d946c384..30af105271a2 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c | |||
@@ -217,6 +217,8 @@ static void release_slot(struct hotplug_slot *hotplug_slot) | |||
217 | kfree(slot->hotplug_slot->info); | 217 | kfree(slot->hotplug_slot->info); |
218 | kfree(slot->hotplug_slot->name); | 218 | kfree(slot->hotplug_slot->name); |
219 | kfree(slot->hotplug_slot); | 219 | kfree(slot->hotplug_slot); |
220 | if (slot->dev) | ||
221 | pci_dev_put(slot->dev); | ||
220 | kfree(slot); | 222 | kfree(slot); |
221 | } | 223 | } |
222 | 224 | ||
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c index c878028ad215..225b5e551dd6 100644 --- a/drivers/pci/hotplug/cpci_hotplug_pci.c +++ b/drivers/pci/hotplug/cpci_hotplug_pci.c | |||
@@ -315,9 +315,12 @@ int cpci_unconfigure_slot(struct slot* slot) | |||
315 | PCI_DEVFN(PCI_SLOT(slot->devfn), i)); | 315 | PCI_DEVFN(PCI_SLOT(slot->devfn), i)); |
316 | if (dev) { | 316 | if (dev) { |
317 | pci_remove_bus_device(dev); | 317 | pci_remove_bus_device(dev); |
318 | slot->dev = NULL; | 318 | pci_dev_put(dev); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | pci_dev_put(slot->dev); | ||
322 | slot->dev = NULL; | ||
323 | |||
321 | dbg("%s - exit", __FUNCTION__); | 324 | dbg("%s - exit", __FUNCTION__); |
322 | return 0; | 325 | return 0; |
323 | } | 326 | } |