]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/slot.c
PCI: stop leaking 'slot_name' in pci_create_slot
[linux-2.6-omap-h63xx.git] / drivers / pci / slot.c
index b6ee352ae459939c3c7063f83d5fb87dff8ca52f..5a8ccb4f604deed50495b61ced5ba403e59e9484 100644 (file)
@@ -121,7 +121,7 @@ static int rename_slot(struct pci_slot *slot, const char *name)
        int result = 0;
        char *slot_name;
 
-       if (strcmp(kobject_name(&slot->kobj), name) == 0)
+       if (strcmp(pci_slot_name(slot), name) == 0)
                return result;
 
        slot_name = make_slot_name(name);
@@ -253,6 +253,7 @@ placeholder:
                 __func__, pci_domain_nr(parent), parent->number, slot_nr);
 
 out:
+       kfree(slot_name);
        up_write(&pci_bus_sem);
        return slot;
 err: