提交 3b5dd45e 编写于 作者: A Alex Chiang 提交者: Jesse Barnes

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: NAlex Chiang <achiang@hp.com>
Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 437f2f91
......@@ -253,6 +253,7 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
__func__, pci_domain_nr(parent), parent->number, slot_nr);
out:
kfree(slot_name);
up_write(&pci_bus_sem);
return slot;
err:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册