f2fs: fix memleak of kobject
authorChao Yu <yuchao0@huawei.com>
Mon, 30 Dec 2019 09:41:41 +0000 (17:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:36:53 +0000 (08:36 +0100)
commit225a5b5bee00b8200320d2860741af7620f4bcdd
tree96c850616b9756cfe8f19c9906f7a25a505bdfaf
parent337c7b95e16ecb707692b70f8370ef4079350b41
f2fs: fix memleak of kobject

[ Upstream commit fe396ad8e7526f059f7b8c7290d33a1b84adacab ]

If kobject_init_and_add() failed, caller needs to invoke kobject_put()
to release kobject explicitly.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/sysfs.c