]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nilfs2: fix memory leak in nilfs_sysfs_create_snapshot_group
authorNanyong Sun <sunnanyong@huawei.com>
Tue, 24 Aug 2021 00:00:02 +0000 (10:00 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:34:56 +0000 (09:34 +1000)
commitf31bdb75f5b877c8c67f8df0688867807eb3a23b
tree23fc8ac7060c256aaccce6a66d29c912202ad1f3
parent46accddc68b58c7e6509e63937105b02708681af
nilfs2: fix memory leak in nilfs_sysfs_create_snapshot_group

If kobject_init_and_add returns with error, kobject_put() is needed here
to avoid memory leak, because kobject_init_and_add may return error
without freeing the memory associated with the kobject it allocated.

Link: https://lkml.kernel.org/r/20210629022556.3985106-6-sunnanyong@huawei.com
Link: https://lkml.kernel.org/r/1625651306-10829-6-git-send-email-konishi.ryusuke@gmail.com
Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
fs/nilfs2/sysfs.c