[PATCH] ext4: check orig_data in remount

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently duplicate data to orig_data in ext4_remount()
but there is lack of check for duplication result.
This patch adds proper check for it.

Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx>
---
 fs/ext4/super.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 00fe75a71c4b..cba245460a9c 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5014,6 +5014,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;
-- 
2.17.1




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux