aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-08-09 14:05:51 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-10-01 18:18:44 -0400
commit57a51048da742c764b6ce5d028c7f334ae04d363 (patch)
tree21a35aa29c1d04b25b7e00bc375e1cc198a01fe8 /fs
parent6938867edba929a65a167a97581231e76aeb10b4 (diff)
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: Bryan Schumaker <bjchuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/idmap.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index a850079467d8..9985a0aea5ff 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -632,9 +632,6 @@ static int nfs_idmap_prepare_message(char *desc, struct idmap *idmap,
632 substring_t substr; 632 substring_t substr;
633 int token, ret; 633 int token, ret;
634 634
635 memset(im, 0, sizeof(*im));
636 memset(msg, 0, sizeof(*msg));
637
638 im->im_type = IDMAP_TYPE_GROUP; 635 im->im_type = IDMAP_TYPE_GROUP;
639 token = match_token(desc, nfs_idmap_tokens, &substr); 636 token = match_token(desc, nfs_idmap_tokens, &substr);
640 637
@@ -677,7 +674,7 @@ static int nfs_idmap_legacy_upcall(struct key_construction *cons,
677 int ret = -ENOMEM; 674 int ret = -ENOMEM;
678 675
679 /* msg and im are freed in idmap_pipe_destroy_msg */ 676 /* msg and im are freed in idmap_pipe_destroy_msg */
680 data = kmalloc(sizeof(*data), GFP_KERNEL); 677 data = kzalloc(sizeof(*data), GFP_KERNEL);
681 if (!data) 678 if (!data)
682 goto out1; 679 goto out1;
683 680