Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PCI: Fix pci_create_slot() reference count leak
kobject_init_and_add() takes a reference even when it fails. If it returns an error, kobject_put() must be called to clean up the memory associated with the object. When kobject_init_and_add() fails, call kobject_put() instead of kfree(). b8eb718 ("net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject") fixed a similar problem. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Qiushi Wu <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
- Loading branch information