Commit 94de56ab authored by Joe Perches's avatar Joe Perches Committed by Theodore Ts'o

ext4: Use vzalloc in ext4_fill_flex_info()

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent af0b44a1
...@@ -1930,14 +1930,13 @@ static int ext4_fill_flex_info(struct super_block *sb) ...@@ -1930,14 +1930,13 @@ static int ext4_fill_flex_info(struct super_block *sb)
size = flex_group_count * sizeof(struct flex_groups); size = flex_group_count * sizeof(struct flex_groups);
sbi->s_flex_groups = kzalloc(size, GFP_KERNEL); sbi->s_flex_groups = kzalloc(size, GFP_KERNEL);
if (sbi->s_flex_groups == NULL) { if (sbi->s_flex_groups == NULL) {
sbi->s_flex_groups = vmalloc(size); sbi->s_flex_groups = vzalloc(size);
if (sbi->s_flex_groups) if (sbi->s_flex_groups == NULL) {
memset(sbi->s_flex_groups, 0, size); ext4_msg(sb, KERN_ERR,
} "not enough memory for %u flex groups",
if (sbi->s_flex_groups == NULL) { flex_group_count);
ext4_msg(sb, KERN_ERR, "not enough memory for " goto failed;
"%u flex groups", flex_group_count); }
goto failed;
} }
for (i = 0; i < sbi->s_groups_count; i++) { for (i = 0; i < sbi->s_groups_count; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment