From f796841e49fe086176e27ed0e1f3f7a1123a4a6b Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Sat, 11 Feb 2012 00:18:30 -0800 Subject: PCI: fix memleak for pci dev removing during hotplug unreferenced object 0xffff880276d17700 (size 64): comm "swapper/0", pid 1, jiffies 4294897182 (age 3976.028s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 18 f9 de 76 02 88 ff ff ...........v.... 10 00 00 00 0e 00 00 00 0f 28 40 00 00 00 00 00 .........(@..... backtrace: [] kmemleak_alloc+0x26/0x43 [] __kmalloc+0x121/0x183 [] pci_add_cap_save_buffer+0x35/0x7c [] pci_allocate_cap_save_buffers+0x1d/0x65 [] pci_device_add+0x92/0xf1 [] pci_scan_single_device+0x9f/0xa1 [] pci_scan_slot.part.20+0x21/0x106 [] pci_scan_slot+0x2b/0x35 [] __pci_scan_child_bus+0x51/0x107 [] pci_scan_bridge+0x376/0x6ae [] __pci_scan_child_bus+0xcd/0x107 [] pci_scan_child_bus+0x11/0x2a [] pci_acpi_scan_root+0x18b/0x21c [] acpi_pci_root_add+0x1e1/0x42a [] acpi_device_probe+0x50/0x190 [] really_probe+0x99/0x126 Need to free saved_buffer for capabilities. Signed-off-by: Yinghai Lu Signed-off-by: Jesse Barnes --- drivers/pci/probe.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/pci/probe.c') diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index aa9b1dec0d3e..dc904bd4b569 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1024,6 +1024,7 @@ static void pci_release_capabilities(struct pci_dev *dev) { pci_vpd_release(dev); pci_iov_release(dev); + pci_free_cap_save_buffers(dev); } /** -- cgit v1.2.3