diff options
Diffstat (limited to 'fs/ext4/xattr.c')
-rw-r--r-- | fs/ext4/xattr.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index b10d68fffb55..12c7d65fb0ca 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
@@ -750,12 +750,11 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, | |||
750 | } | 750 | } |
751 | } else { | 751 | } else { |
752 | /* Allocate a buffer where we construct the new block. */ | 752 | /* Allocate a buffer where we construct the new block. */ |
753 | s->base = kmalloc(sb->s_blocksize, GFP_KERNEL); | 753 | s->base = kzalloc(sb->s_blocksize, GFP_KERNEL); |
754 | /* assert(header == s->base) */ | 754 | /* assert(header == s->base) */ |
755 | error = -ENOMEM; | 755 | error = -ENOMEM; |
756 | if (s->base == NULL) | 756 | if (s->base == NULL) |
757 | goto cleanup; | 757 | goto cleanup; |
758 | memset(s->base, 0, sb->s_blocksize); | ||
759 | header(s->base)->h_magic = cpu_to_le32(EXT4_XATTR_MAGIC); | 758 | header(s->base)->h_magic = cpu_to_le32(EXT4_XATTR_MAGIC); |
760 | header(s->base)->h_blocks = cpu_to_le32(1); | 759 | header(s->base)->h_blocks = cpu_to_le32(1); |
761 | header(s->base)->h_refcount = cpu_to_le32(1); | 760 | header(s->base)->h_refcount = cpu_to_le32(1); |