[PATCH] PCI: stop leaking 'slot_name' in pci_create_slot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In function pci_create_slot(), 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@xxxxxxxxxx
Signed-off-by: Alex Chiang <achiang@xxxxxx>
---
Jesse, this is .28 material. It was introduced by me when doing
the duplicate slot name stuff. :-/

I backported the .28 duplicate slot name stuff back to the .27.y
stable series, so this patch should be applied on top of my
backport.

diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
index 4dd1c3e..5a8ccb4 100644
--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -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:
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux