Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21ac738e authored by Chengguang Xu's avatar Chengguang Xu Committed by Theodore Ts'o
Browse files

ext4: check allocation failure when duplicating "data" in ext4_remount()



There is no check for allocation failure when duplicating
"data" in ext4_remount(). Check for failure and return
error -ENOMEM in this case.

Signed-off-by: default avatarChengguang Xu <cgxu519@gmx.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Reviewed-by: default avatarAndreas Dilger <adilger@dilger.ca>
parent 7f144fd0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5101,6 +5101,9 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
#endif
	char *orig_data = kstrdup(data, GFP_KERNEL);

	if (data && !orig_data)
		return -ENOMEM;

	/* Store the original options */
	old_sb_flags = sb->s_flags;
	old_opts.s_mount_opt = sbi->s_mount_opt;