On Thu, Aug 21, 2008 at 02:25:04PM -0600, Matthew Wilcox wrote:Ah, no the driver core isn't supposed to do this, it's something the pci functions do out of "niceness" as that's how we can use them in an iterator properly. Does the following (untested) patch fix the issue for you all? thanks, greg k-h -------------- Subject: PCI: fix reference leak in pci_get_dev_by_id() From: Greg Kroah-Hartman <gregkh@suse.de> Alex Chiang and Matthew Wilcox pointed out that pci_get_dev_by_id() does not properly decrement the reference on the from pointer if it is present, like the documentation for the function states it will. Cc: Matthew Wilcox <matthew@wil.cx> Cc: Alex Chiang <achiang@hp.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> diff --git a/drivers/pci/search.c b/drivers/pci/search.c index 217814f..3b3b5f1 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c @@ -280,6 +280,8 @@ static struct pci_dev *pci_get_dev_by_id(const struct pci_device_id *id, match_pci_dev_by_id); if (dev) pdev = to_pci_dev(dev); + if (from) + pci_dev_put(from); return pdev; } --
| Greg Kroah-Hartman | [PATCH 002/196] Chinese: rephrase English introduction in HOWTO |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Roland Dreier | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Radu Rendec | htb parallelism on multi-core platforms |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
