[patch 72/83] PCI: stop leaking slot_name in pci_create_slot

From: Greg KH
Date: Thu Dec 11 2008 - 14:44:06 EST


2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------

From: Alex Chiang <achiang@xxxxxx>

commit 3b5dd45e947ecd21491e1658fba7bb4bc4a54995 upstream.

In pci_create_slot(), the local variable 'slot_name' is allocated by
make_slot_name(), but never freed. We never use it after passing it to
the kobject core, so we should free it upon function exit.

Signed-off-by: Alex Chiang <achiang@xxxxxx>
Signed-off-by: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/pci/slot.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -243,6 +243,7 @@ placeholder:
__func__, pci_domain_nr(parent), parent->number, slot_nr);

out:
+ kfree(slot_name);
up_write(&pci_bus_sem);
return slot;
err:

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/