Commit e9b00f99 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

mount: Simplify mnt_entry_alloc

Allocate it with xzalloc instead of massive
NULL assignment. Moreover, don't forget to
initialize @siblings.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent afd4b007
...@@ -637,18 +637,11 @@ struct mount_info *mnt_entry_alloc() ...@@ -637,18 +637,11 @@ struct mount_info *mnt_entry_alloc()
{ {
struct mount_info *new; struct mount_info *new;
new = xmalloc(sizeof(struct mount_info)); new = xzalloc(sizeof(struct mount_info));
if (new == NULL) if (new) {
return NULL; INIT_LIST_HEAD(&new->children);
INIT_LIST_HEAD(&new->siblings);
new->root = NULL; }
new->mountpoint = NULL;
new->source = NULL;
new->options = NULL;
new->parent = NULL;
INIT_LIST_HEAD(&new->children);
return new; return new;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment