Re: refcount leak in pci_get_device()?

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Greg KH <gregkh@...>
Cc: Matthew Wilcox <matthew@...>, <linux-pci@...>, <linux-kernel@...>
Date: Thursday, August 21, 2008 - 6: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, 4:19 pm)
Re: refcount leak in pci_get_device()?, Greg KH, (Thu Aug 21, 4:40 pm)
Re: refcount leak in pci_get_device()?, Matthew Wilcox, (Thu Aug 21, 4:25 pm)
Re: refcount leak in pci_get_device()?, Greg KH, (Thu Aug 21, 4:47 pm)
Re: refcount leak in pci_get_device()?, Jesse Barnes, (Thu Aug 21, 6:23 pm)
Re: refcount leak in pci_get_device()?, Henrique de Moraes Holschuh..., (Thu Aug 21, 9:04 pm)
Re: refcount leak in pci_get_device()?, Henrique de Moraes Holschuh..., (Thu Aug 21, 9:09 pm)
Re: refcount leak in pci_get_device()?, Alex Chiang, (Thu Aug 21, 6:14 pm)
RE: refcount leak in pci_get_device()?, Zhao, Yu, (Sat Aug 30, 12:23 am)
Re: refcount leak in pci_get_device()?, Greg KH, (Sat Aug 30, 1:37 am)
RE: refcount leak in pci_get_device()?, Zhao, Yu, (Sat Aug 30, 2:20 am)
[PATCH] PCI Hotplug: fakephp: fix deadlock... again, Alex Chiang, (Mon Sep 1, 2:40 pm)
Re: [PATCH] PCI Hotplug: fakephp: fix deadlock... again, Matthew Wilcox, (Mon Sep 1, 8:10 pm)
Re: [PATCH] PCI Hotplug: fakephp: fix deadlock... again, Jesse Barnes, (Tue Sep 9, 12:12 am)
Re: [PATCH] PCI Hotplug: fakephp: fix deadlock... again, Matthew Wilcox, (Tue Sep 9, 12:27 am)
Re: [PATCH] PCI Hotplug: fakephp: fix deadlock... again, Andrew Patterson, (Tue Sep 9, 1:32 am)