Skip to contentSkip to conversation

nilfs2-fix-memory-leak-in-nilfs_sysfs_create_snapshot_group.patch removed from -mm tree

merged [email protected] 1 participant 1 message Sep 9, 2021

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: nilfs2: fix memory leak in nilfs_sysfs_create_snapshot_group
has been removed from the -mm tree. Its filename was
nilfs2-fix-memory-leak-in-nilfs_sysfs_create_snapshot_group.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Nanyong Sun <[email protected]>
Subject: 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.

---

 fs/nilfs2/sysfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nilfs2/sysfs.c renamed from fs/nilfs2/sysfs.c~nilfs2-fix-memory-leak-in-nilfs_sysfs_create_snapshot_group +2 -2
@@ -195,9 +195,9 @@ int nilfs_sysfs_create_snapshot_group(st
 	}
 
 	if (err)
-		return err;
+		kobject_put(&root->snapshot_kobj);
 
-	return 0;
+	return err;
 }
 
 void nilfs_sysfs_delete_snapshot_group(struct nilfs_root *root)

_

Patches currently in -mm which might be from [email protected] are