linux-stable/fs/ocfs2
Tobin C. Harding c7fb6b75de ocfs2: fix error path kobject memory leak
[ Upstream commit b9fba67b38 ]

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>
2019-06-22 08:15:21 +02:00
..
cluster ocfs2: fix a panic problem caused by o2cb_ctl 2019-04-05 22:32:59 +02:00
dlm ocfs2: improve ocfs2 Makefile 2019-02-12 19:47:18 +01:00
dlmfs ocfs2: improve ocfs2 Makefile 2019-02-12 19:47:18 +01:00
acl.c ocfs2/acl: use 'ip_xattr_sem' to protect getting extended attribute 2018-01-31 17:18:35 -08:00
acl.h ocfs2: make ocfs2_set_acl() static 2017-09-06 17:27:24 -07:00
alloc.c ocfs2: clean up some unnecessary code 2018-08-17 16:20:27 -07:00
alloc.h ocfs2: try to reuse extent block in dealloc without meta_alloc 2018-01-31 17:18:35 -08:00
aops.c ocfs2: free up write context when direct IO failed 2018-11-21 09:19:18 +01:00
aops.h ocfs2: keep the trace point consistent with the function name 2018-04-05 21:36:21 -07:00
blockcheck.c
blockcheck.h
buffer_head_io.c ocfs2: don't clear bh uptodate for block read 2019-02-12 19:47:18 +01:00
buffer_head_io.h ocfs2: clean up some unused function declarations 2017-11-15 18:21:01 -08:00
dcache.c fs/ocfs2: fix race in ocfs2_dentry_attach_lock() 2019-06-19 08:18:00 +02:00
dcache.h
dir.c ocfs2: fix a misuse a of brelse after failing ocfs2_check_dir_entry 2018-11-21 09:19:18 +01:00
dir.h
dlmglue.c ocfs2: fix a GCC warning 2018-10-13 09:31:02 +02:00
dlmglue.h ocfs2: ocfs2_inode_lock_tracker does not distinguish lock level 2018-06-07 17:34:33 -07:00
export.c ocfs2: fix ocfs2 read inode data panic in ocfs2_iget 2019-05-22 07:37:40 +02:00
export.h
extent_map.c ocfs2: add ocfs2_overwrite_io() 2018-01-31 17:18:35 -08:00
extent_map.h ocfs2: add ocfs2_overwrite_io() 2018-01-31 17:18:35 -08:00
file.c vfs: dedupe: rationalize args 2018-07-06 23:57:03 +02:00
file.h ocfs2: clean up redundant function declarations 2018-06-07 17:34:33 -07:00
filecheck.c ocfs2: fix error path kobject memory leak 2019-06-22 08:15:21 +02:00
filecheck.h ocfs2: add kobject for online file check 2018-04-05 21:36:22 -07:00
heartbeat.c
heartbeat.h
inode.c ocfs2: clean up some unnecessary code 2018-08-17 16:20:27 -07:00
inode.h ocfs2: convert inode refcount test to a helper 2016-12-10 12:39:45 -08:00
ioctl.c ocfs2: eliminate a misreported warning 2018-06-07 17:34:33 -07:00
ioctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
journal.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
journal.h
Kconfig
localalloc.c ocfs2: fix panic due to unrecovered local alloc 2019-01-26 09:32:43 +01:00
localalloc.h
locks.c
locks.h
Makefile ocfs2: improve ocfs2 Makefile 2019-02-12 19:47:18 +01:00
mmap.c fs: ocfs2: use new return type vm_fault_t 2018-06-07 17:34:34 -07:00
mmap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
move_extents.c ocfs2: fix deadlock caused by ocfs2_defrag_extent() 2018-12-17 09:24:40 +01:00
move_extents.h
namei.c ocfs2: drop a VLA in ocfs2_orphan_del() 2018-06-07 17:34:34 -07:00
namei.h
ocfs1_fs_compat.h
ocfs2.h ocfs2: add kobject for online file check 2018-04-05 21:36:22 -07:00
ocfs2_fs.h ocfs2: correct the comments position of struct ocfs2_dir_block_trailer 2018-06-07 17:34:34 -07:00
ocfs2_ioctl.h
ocfs2_lockid.h ocfs2: add trimfs dlm lock resource 2018-01-31 17:18:35 -08:00
ocfs2_lockingver.h
ocfs2_trace.h ocfs2: keep the trace point consistent with the function name 2018-04-05 21:36:21 -07:00
quota.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
quota_global.c ocfs2: convert to new i_version API 2018-01-29 06:42:21 -05:00
quota_local.c ocfs2: return -EROFS when filesystem becomes read-only 2018-08-17 16:20:27 -07:00
refcounttree.c ocfs2: fix inode bh swapping mixup in ocfs2_reflink_inodes_lock 2019-04-03 06:26:23 +02:00
refcounttree.h ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features 2016-12-10 12:39:45 -08:00
reservations.c
reservations.h
resize.c
resize.h
slot_map.c
slot_map.h
stack_o2cb.c
stack_user.c treewide: Align function definition open/close braces 2018-03-26 11:13:09 +02:00
stackglue.c ocfs2: constify attribute_group structures 2017-07-06 16:24:30 -07:00
stackglue.h ocfs2: fix crash caused by stale lvb with fsdlm plugin 2017-01-10 18:31:54 -08:00
suballoc.c ocfs2: remove two unused functions from suballoc.c 2018-04-05 21:36:22 -07:00
suballoc.h
super.c ocfs2: add kobject for online file check 2018-04-05 21:36:22 -07:00
super.h ocfs2: remove unused declaration ocfs2_publish_get_mount_state() 2017-11-15 18:21:01 -08:00
symlink.c vfs: remove ".readlink = generic_readlink" assignments 2016-12-09 16:45:04 +01:00
symlink.h
sysfile.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
sysfile.h
uptodate.c ocfs2: remove unnecessary null pointer check before kmem_cache_destroy() 2018-04-05 21:36:22 -07:00
uptodate.h
xattr.c ocfs2: use 'osb' instead of 'OCFS2_SB()' 2018-04-05 21:36:21 -07:00
xattr.h