1 ext4: check allocation failure when duplicating "data" in ext4_remount()
3 From: Chengguang Xu <cgxu519@gmx.com>
5 There is no check for allocation failure when duplicating
6 "data" in ext4_remount(). Check for failure and return
7 error -ENOMEM in this case.
9 Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 Reviewed-by: Andreas Dilger <adilger@dilger.ca>
14 - Modify changelog for easy understading.
16 fs/ext4/super.c | 3 +++
17 1 file changed, 3 insertions(+)
19 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
20 index 0c4c2201b3aa..f9c3da513cae 100644
23 @@ -5014,6 +5014,9 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
25 char *orig_data = kstrdup(data, GFP_KERNEL);
27 + if (data && !orig_data)
30 /* Store the original options */
31 old_sb_flags = sb->s_flags;
32 old_opts.s_mount_opt = sbi->s_mount_opt;