]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
PCI: stop leaking 'slot_name' in pci_create_slot
authorAlex Chiang <achiang@hp.com>
Tue, 2 Dec 2008 01:17:21 +0000 (18:17 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 13 Dec 2008 23:29:32 +0000 (15:29 -0800)
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@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/slot.c

index b703b097ce106e6926bbec57cc673c03761eac73..e423fd9e8f3dfe72df67416c0f69965a961f46a7 100644 (file)
@@ -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: