summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-12-19 22:21:02 -0500
committerTheodore Ts'o <tytso@mit.edu>2010-12-19 22:21:02 -0500
commit94de56ab2062be59d80e2efb7c0dc60ecf616075 (patch)
treeec2049ff864708b04fd1d109af0b28cd288884c5 /fs
parentaf0b44a1970fed1cda31d2969c99c46ffc515160 (diff)
downloadlinux-94de56ab2062be59d80e2efb7c0dc60ecf616075.tar.gz
linux-94de56ab2062be59d80e2efb7c0dc60ecf616075.tar.bz2
linux-94de56ab2062be59d80e2efb7c0dc60ecf616075.zip
ext4: Use vzalloc in ext4_fill_flex_info()
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/super.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 072ff973ff2b..10290f8f5922 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1930,14 +1930,13 @@ static int ext4_fill_flex_info(struct super_block *sb)
size = flex_group_count * sizeof(struct flex_groups);
sbi->s_flex_groups = kzalloc(size, GFP_KERNEL);
if (sbi->s_flex_groups == NULL) {
- sbi->s_flex_groups = vmalloc(size);
- if (sbi->s_flex_groups)
- memset(sbi->s_flex_groups, 0, size);
- }
- if (sbi->s_flex_groups == NULL) {
- ext4_msg(sb, KERN_ERR, "not enough memory for "
- "%u flex groups", flex_group_count);
- goto failed;
+ sbi->s_flex_groups = vzalloc(size);
+ if (sbi->s_flex_groups == NULL) {
+ ext4_msg(sb, KERN_ERR,
+ "not enough memory for %u flex groups",
+ flex_group_count);
+ goto failed;
+ }
}
for (i = 0; i < sbi->s_groups_count; i++) {