Browse Source

PCI: stop leaking 'slot_name' in pci_create_slot

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.

Cc: stable@kernel.org
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Alex Chiang 16 years ago
parent
commit
3b5dd45e94
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/pci/slot.c

+ 1 - 0
drivers/pci/slot.c

@@ -253,6 +253,7 @@ placeholder:
 		 __func__, pci_domain_nr(parent), parent->number, slot_nr);
 		 __func__, pci_domain_nr(parent), parent->number, slot_nr);
 
 
 out:
 out:
+	kfree(slot_name);
 	up_write(&pci_bus_sem);
 	up_write(&pci_bus_sem);
 	return slot;
 	return slot;
 err:
 err: