Commit 57a51048 authored by Bryan Schumaker's avatar Bryan Schumaker Committed by Trond Myklebust

NFS: Use kzalloc() instead of kmalloc() in the idmapper

This will allocate memory that has already been zeroed, allowing us to
remove the memset later on.
Signed-off-by: default avatarBryan Schumaker <bjchuma@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 6938867e
...@@ -632,9 +632,6 @@ static int nfs_idmap_prepare_message(char *desc, struct idmap *idmap, ...@@ -632,9 +632,6 @@ static int nfs_idmap_prepare_message(char *desc, struct idmap *idmap,
substring_t substr; substring_t substr;
int token, ret; int token, ret;
memset(im, 0, sizeof(*im));
memset(msg, 0, sizeof(*msg));
im->im_type = IDMAP_TYPE_GROUP; im->im_type = IDMAP_TYPE_GROUP;
token = match_token(desc, nfs_idmap_tokens, &substr); token = match_token(desc, nfs_idmap_tokens, &substr);
...@@ -677,7 +674,7 @@ static int nfs_idmap_legacy_upcall(struct key_construction *cons, ...@@ -677,7 +674,7 @@ static int nfs_idmap_legacy_upcall(struct key_construction *cons,
int ret = -ENOMEM; int ret = -ENOMEM;
/* msg and im are freed in idmap_pipe_destroy_msg */ /* msg and im are freed in idmap_pipe_destroy_msg */
data = kmalloc(sizeof(*data), GFP_KERNEL); data = kzalloc(sizeof(*data), GFP_KERNEL);
if (!data) if (!data)
goto out1; goto out1;
......
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