summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2006-04-06 15:41:41 -0500
committerPaul Mackerras <paulus@samba.org>2006-04-13 09:34:15 -0700
commitb055a9e10fd05c7fdd87904a50c1f413aea10ec4 (patch)
treebc9e515f6280ff0c4cf40b811c43266b363cb866 /arch/powerpc
parent6f806ceed53776ae5e04c8b334dc9daa0932ad1e (diff)
downloadlinux-0-day-b055a9e10fd05c7fdd87904a50c1f413aea10ec4.tar.gz
linux-0-day-b055a9e10fd05c7fdd87904a50c1f413aea10ec4.tar.xz
[PATCH] powerpc/pseries: bugfix: balance calls to pci_device_put
Repeated calls to eeh_remove_device() can result in multiple (and thus unbalanced) calls to pci_dev_put(). Make sure the pci_device_put() is called only once (since there was only one call to the matching pci_device_get()). Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 780fb27a0099e..32eaddfa5470a 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -957,8 +957,10 @@ static void eeh_remove_device(struct pci_dev *dev)
pci_addr_cache_remove_device(dev);
dn = pci_device_to_OF_node(dev);
- PCI_DN(dn)->pcidev = NULL;
- pci_dev_put (dev);
+ if (PCI_DN(dn)->pcidev) {
+ PCI_DN(dn)->pcidev = NULL;
+ pci_dev_put (dev);
+ }
}
void eeh_remove_bus_device(struct pci_dev *dev)