diff options
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/super.c | 3 | ||||
-rw-r--r-- | fs/ext2/xattr.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index d978d3febb8c..69435fbe53f2 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -655,11 +655,10 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
655 | int i, j; | 655 | int i, j; |
656 | __le32 features; | 656 | __le32 features; |
657 | 657 | ||
658 | sbi = kmalloc(sizeof(*sbi), GFP_KERNEL); | 658 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); |
659 | if (!sbi) | 659 | if (!sbi) |
660 | return -ENOMEM; | 660 | return -ENOMEM; |
661 | sb->s_fs_info = sbi; | 661 | sb->s_fs_info = sbi; |
662 | memset(sbi, 0, sizeof(*sbi)); | ||
663 | 662 | ||
664 | /* | 663 | /* |
665 | * See what the current blocksize for the device is, and | 664 | * See what the current blocksize for the device is, and |
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index 86ae8e93adb9..af52a7f8b291 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c | |||
@@ -521,11 +521,10 @@ bad_block: ext2_error(sb, "ext2_xattr_set", | |||
521 | } | 521 | } |
522 | } else { | 522 | } else { |
523 | /* Allocate a buffer where we construct the new block. */ | 523 | /* Allocate a buffer where we construct the new block. */ |
524 | header = kmalloc(sb->s_blocksize, GFP_KERNEL); | 524 | header = kzalloc(sb->s_blocksize, GFP_KERNEL); |
525 | error = -ENOMEM; | 525 | error = -ENOMEM; |
526 | if (header == NULL) | 526 | if (header == NULL) |
527 | goto cleanup; | 527 | goto cleanup; |
528 | memset(header, 0, sb->s_blocksize); | ||
529 | end = (char *)header + sb->s_blocksize; | 528 | end = (char *)header + sb->s_blocksize; |
530 | header->h_magic = cpu_to_le32(EXT2_XATTR_MAGIC); | 529 | header->h_magic = cpu_to_le32(EXT2_XATTR_MAGIC); |
531 | header->h_blocks = header->h_refcount = cpu_to_le32(1); | 530 | header->h_blocks = header->h_refcount = cpu_to_le32(1); |