diff options
author | Tobin C. Harding <tobin@kernel.org> | 2019-05-31 22:30:29 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-22 08:15:21 +0200 |
commit | c7fb6b75def2c2a4bf2902006099ae586fcdb234 (patch) | |
tree | a9bc2ffce171cb50b100e7519f0ab5d3fd9d2456 /mm/balloon_compaction.c | |
parent | fedb1b9c9191687a7ceb117b8dc444d0d321692a (diff) | |
download | linux-stable-c7fb6b75def2c2a4bf2902006099ae586fcdb234.tar.gz linux-stable-c7fb6b75def2c2a4bf2902006099ae586fcdb234.tar.bz2 linux-stable-c7fb6b75def2c2a4bf2902006099ae586fcdb234.zip |
ocfs2: fix error path kobject memory leak
[ Upstream commit b9fba67b3806e21b98bd5a98dc3921a8e9b42d61 ]
If a call to kobject_init_and_add() fails we should call kobject_put()
otherwise we leak memory.
Add call to kobject_put() in the error path of call to
kobject_init_and_add(). Please note, this has the side effect that the
release method is called if kobject_init_and_add() fails.
Link: http://lkml.kernel.org/r/20190513033458.2824-1-tobin@kernel.org
Signed-off-by: Tobin C. Harding <tobin@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'mm/balloon_compaction.c')
0 files changed, 0 insertions, 0 deletions