Skip to content

Commit 17243e1

Browse files
sunnanyongtorvalds
authored andcommitted
nilfs2: fix memory leak in nilfs_sysfs_delete_snapshot_group
kobject_put() should be used to cleanup the memory associated with the kobject instead of kobject_del(). See the section "Kobject removal" of "Documentation/core-api/kobject.rst". Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Nanyong Sun <[email protected]> Signed-off-by: Ryusuke Konishi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent b2fe39c commit 17243e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nilfs2/sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ int nilfs_sysfs_create_snapshot_group(struct nilfs_root *root)
202202

203203
void nilfs_sysfs_delete_snapshot_group(struct nilfs_root *root)
204204
{
205-
kobject_del(&root->snapshot_kobj);
205+
kobject_put(&root->snapshot_kobj);
206206
}
207207

208208
/************************************************************************

0 commit comments

Comments
 (0)