From: James Hogan Date: Wed, 27 Mar 2013 10:47:14 +0000 (+0000) Subject: hostfs: use kmalloc instead of kzalloc X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=371fdab10033528c42f64fc244c30d67b15e529d;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git hostfs: use kmalloc instead of kzalloc The inode info structure is zeroed at allocation with kzalloc, and then all but one of the fields (including the largest, vfs_inode) are initialised explicitly. Switch to using kmalloc and initialise the remaining field too. Reported-by: Al Viro Signed-off-by: James Hogan Signed-off-by: Al Viro --- diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index f2372ef80850..32f35f187989 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -228,10 +228,11 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb) { struct hostfs_inode_info *hi; - hi = kzalloc(sizeof(*hi), GFP_KERNEL); + hi = kmalloc(sizeof(*hi), GFP_KERNEL); if (hi == NULL) return NULL; hi->fd = -1; + hi->mode = 0; inode_init_once(&hi->vfs_inode); return &hi->vfs_inode; }