Skip to content

Commit

Permalink
[PATCH] powerpc/pseries: bugfix: balance calls to pci_device_put
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linas Vepstas authored and Paul Mackerras committed Apr 13, 2006
1 parent 6f806ce commit b055a9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/powerpc/platforms/pseries/eeh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b055a9e

Please sign in to comment.