diff options
author | Qiushi Wu <wu000273@umn.edu> | 2020-05-28 05:13:22 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-03 12:26:45 +0300 |
commit | 4410fd0c378eb5c44487056dea43fc1bf8ea601b (patch) | |
tree | f048226a5fa5d44374c549caf27fc996bc503f13 /arch/arm | |
parent | 201838142c521b93e6ac380449697bd68f0cf445 (diff) | |
download | linux-4410fd0c378eb5c44487056dea43fc1bf8ea601b.tar.xz |
PCI: Fix pci_create_slot() reference count leak
[ Upstream commit 8a94644b440eef5a7b9c104ac8aa7a7f413e35e5 ]
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().
b8eb718348b8 ("net-sysfs: Fix reference count leak in
rx|netdev_queue_add_kobject") fixed a similar problem.
Link: https://lore.kernel.org/r/20200528021322.1984-1-wu000273@umn.edu
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/arm')
0 files changed, 0 insertions, 0 deletions