]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/core: Fix several reference count leaks.
authorQiushi Wu <wu000273@umn.edu>
Thu, 28 May 2020 03:02:30 +0000 (22:02 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:28 +0000 (17:48 +0200)
commit86f04de9f36d2177b1a67ad93d0bc13ce1152b83
tree20b803f85a3a083fe139fc7a3ec6888a50ecddac
parente0907e4085deca523739b410995b6ba6c25e2964
RDMA/core: Fix several reference count leaks.

[ Upstream commit 0b8e125e213204508e1b3c4bdfe69713280b7abd ]

kobject_init_and_add() takes reference even when it fails.  If this
function returns an error, kobject_put() must be called to properly clean
up the memory associated with the object. Previous
commit b8eb718348b8 ("net-sysfs: Fix reference count leak in
rx|netdev_queue_add_kobject") fixed a similar problem.

Link: https://lore.kernel.org/r/20200528030231.9082-1-wu000273@umn.edu
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/sysfs.c