diff options
Diffstat (limited to 'fs/ext2/super.c')
-rw-r--r-- | fs/ext2/super.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 3eefa97fe204..a6b1072daea7 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -883,13 +883,11 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
883 | goto failed_mount; | 883 | goto failed_mount; |
884 | } | 884 | } |
885 | bgl_lock_init(&sbi->s_blockgroup_lock); | 885 | bgl_lock_init(&sbi->s_blockgroup_lock); |
886 | sbi->s_debts = kmalloc(sbi->s_groups_count * sizeof(*sbi->s_debts), | 886 | sbi->s_debts = kcalloc(sbi->s_groups_count, sizeof(*sbi->s_debts), GFP_KERNEL); |
887 | GFP_KERNEL); | ||
888 | if (!sbi->s_debts) { | 887 | if (!sbi->s_debts) { |
889 | printk ("EXT2-fs: not enough memory\n"); | 888 | printk ("EXT2-fs: not enough memory\n"); |
890 | goto failed_mount_group_desc; | 889 | goto failed_mount_group_desc; |
891 | } | 890 | } |
892 | memset(sbi->s_debts, 0, sbi->s_groups_count * sizeof(*sbi->s_debts)); | ||
893 | for (i = 0; i < db_count; i++) { | 891 | for (i = 0; i < db_count; i++) { |
894 | block = descriptor_loc(sb, logic_sb_block, i); | 892 | block = descriptor_loc(sb, logic_sb_block, i); |
895 | sbi->s_group_desc[i] = sb_bread(sb, block); | 893 | sbi->s_group_desc[i] = sb_bread(sb, block); |