提交 371fdab1 编写于 作者: J James Hogan 提交者: Al Viro

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: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 2b3b9bb0
...@@ -228,10 +228,11 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb) ...@@ -228,10 +228,11 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb)
{ {
struct hostfs_inode_info *hi; struct hostfs_inode_info *hi;
hi = kzalloc(sizeof(*hi), GFP_KERNEL); hi = kmalloc(sizeof(*hi), GFP_KERNEL);
if (hi == NULL) if (hi == NULL)
return NULL; return NULL;
hi->fd = -1; hi->fd = -1;
hi->mode = 0;
inode_init_once(&hi->vfs_inode); inode_init_once(&hi->vfs_inode);
return &hi->vfs_inode; return &hi->vfs_inode;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册