Re: refcount leak in pci_get_device()?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alex Chiang
Date: Thursday, August 21, 2008 - 3:14 pm

* Greg KH <gregkh@suse.de>:

Perfect, yes.

I applied it, and observed the refcount on the device I was using
to debug this problem.

I was able to modprobe acpiphp successfully, and echo 0 into the
device's 'power' file.

I then watched the rest of the hotplug core do its thing,
decrementing the refcount properly along the way, and at the end,
we did call pci_release_dev(), as I originally expected to. :)

Just to verify, I toggled the device's power a few times (echoing
a 1 and then a 0, etc.) and watched the refcounts. After each
offline, we properly called pci_release_dev().

Thanks for fixing this. It fixes a pretty bad leak in the hotplug
core (we were leaking an entire struct pci_dev * # of functions
for each offlined card, the first time around; subsequent
onlines/offlines were ok).

Tested-by: Alex Chiang <achiang@hp.com>

/ac

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
refcount leak in pci_get_device()?, Alex Chiang, (Thu Aug 21, 1:19 pm)
Re: refcount leak in pci_get_device()?, Matthew Wilcox, (Thu Aug 21, 1:25 pm)
Re: refcount leak in pci_get_device()?, Greg KH, (Thu Aug 21, 1:40 pm)
Re: refcount leak in pci_get_device()?, Greg KH, (Thu Aug 21, 1:47 pm)
Re: refcount leak in pci_get_device()?, Alex Chiang, (Thu Aug 21, 3:14 pm)
Re: refcount leak in pci_get_device()?, Jesse Barnes, (Thu Aug 21, 3:23 pm)
Re: refcount leak in pci_get_device()?, Henrique de Moraes H ..., (Thu Aug 21, 6:04 pm)
Re: refcount leak in pci_get_device()?, Henrique de Moraes H ..., (Thu Aug 21, 6:09 pm)
RE: refcount leak in pci_get_device()?, Zhao, Yu, (Fri Aug 29, 9:23 pm)
Re: refcount leak in pci_get_device()?, Greg KH, (Fri Aug 29, 10:37 pm)
RE: refcount leak in pci_get_device()?, Zhao, Yu, (Fri Aug 29, 11:20 pm)
[PATCH] PCI Hotplug: fakephp: fix deadlock... again, Alex Chiang, (Mon Sep 1, 11:40 am)
Re: [PATCH] PCI Hotplug: fakephp: fix deadlock... again, Matthew Wilcox, (Mon Sep 1, 5:10 pm)
Re: [PATCH] PCI Hotplug: fakephp: fix deadlock... again, Matthew Wilcox, (Mon Sep 8, 9:27 pm)
Re: [PATCH] PCI Hotplug: fakephp: fix deadlock... again, Andrew Patterson, (Mon Sep 8, 10:32 pm)