diff options
author | Linas Vepstas <linas@austin.ibm.com> | 2006-04-06 16:41:41 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-04-13 12:34:15 -0400 |
commit | b055a9e10fd05c7fdd87904a50c1f413aea10ec4 (patch) | |
tree | bc9e515f6280ff0c4cf40b811c43266b363cb866 /arch/powerpc | |
parent | 6f806ceed53776ae5e04c8b334dc9daa0932ad1e (diff) |
[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.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 780fb27a0099..32eaddfa5470 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) | |||
957 | pci_addr_cache_remove_device(dev); | 957 | pci_addr_cache_remove_device(dev); |
958 | 958 | ||
959 | dn = pci_device_to_OF_node(dev); | 959 | dn = pci_device_to_OF_node(dev); |
960 | PCI_DN(dn)->pcidev = NULL; | 960 | if (PCI_DN(dn)->pcidev) { |
961 | pci_dev_put (dev); | 961 | PCI_DN(dn)->pcidev = NULL; |
962 | pci_dev_put (dev); | ||
963 | } | ||
962 | } | 964 | } |
963 | 965 | ||
964 | void eeh_remove_bus_device(struct pci_dev *dev) | 966 | void eeh_remove_bus_device(struct pci_dev *dev) |