]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
PCI: fix reference leak in pci_get_dev_by_id()
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 25 Aug 2008 20:05:06 +0000 (20:05 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 8 Sep 2008 11:44:15 +0000 (04:44 -0700)
commit045eff1504ce63a080b79f931ec3d8e136fb65cd
treeb3e734009e625b9fbba8e2522ba8bd3c8ec89238
parent363875f5551b029ae63b5b1a3f3ccd72b9460339
PCI: fix reference leak in pci_get_dev_by_id()

commit ebca4f1bce1eb7b91a63c515db66316db9391221 upstream

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.

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

Cc: Matthew Wilcox <matthew@wil.cx>
Tested-by: Alex Chiang <achiang@hp.com>
Acked-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/search.c