https://github.com/torvalds/linux
Revision b9fba67b3806e21b98bd5a98dc3921a8e9b42d61 authored by Tobin C. Harding on 01 June 2019, 05:30:29 UTC, committed by Linus Torvalds on 01 June 2019, 22:51:31 UTC
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>
1 parent 3e85899
History
Tip revision: b9fba67b3806e21b98bd5a98dc3921a8e9b42d61 authored by Tobin C. Harding on 01 June 2019, 05:30:29 UTC
ocfs2: fix error path kobject memory leak
Tip revision: b9fba67
File Mode Size
Kconfig -rw-r--r-- 508 bytes
Makefile -rw-r--r-- 366 bytes
netlabel_addrlist.c -rw-r--r-- 9.7 KB
netlabel_addrlist.h -rw-r--r-- 5.5 KB
netlabel_calipso.c -rw-r--r-- 19.0 KB
netlabel_calipso.h -rw-r--r-- 3.9 KB
netlabel_cipso_v4.c -rw-r--r-- 21.0 KB
netlabel_cipso_v4.h -rw-r--r-- 4.1 KB
netlabel_domainhash.c -rw-r--r-- 27.3 KB
netlabel_domainhash.h -rw-r--r-- 3.1 KB
netlabel_kapi.c -rw-r--r-- 37.3 KB
netlabel_mgmt.c -rw-r--r-- 21.6 KB
netlabel_mgmt.h -rw-r--r-- 6.0 KB
netlabel_unlabeled.c -rw-r--r-- 41.6 KB
netlabel_unlabeled.h -rw-r--r-- 6.3 KB
netlabel_user.c -rw-r--r-- 2.6 KB
netlabel_user.h -rw-r--r-- 1.3 KB

back to top