summaryrefslogtreecommitdiffstats
path: root/fs/hostfs
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2013-03-27 11:47:14 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2013-05-04 21:48:45 +0200
commit371fdab10033528c42f64fc244c30d67b15e529d (patch)
treea034feee1863945b7c6aeba6d5cfa98dcba58d91 /fs/hostfs
parenthostfs: move HOSTFS_SUPER_MAGIC to <linux/magic.h> (diff)
downloadlinux-371fdab10033528c42f64fc244c30d67b15e529d.tar.xz
linux-371fdab10033528c42f64fc244c30d67b15e529d.zip
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 <viro@zeniv.linux.org.uk> Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hostfs')
-rw-r--r--fs/hostfs/hostfs_kern.c3
1 files changed, 2 insertions, 1 deletions
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;
}