From: Bryan Schumaker Date: Thu, 9 Aug 2012 18:05:51 +0000 (-0400) Subject: NFS: Use kzalloc() instead of kmalloc() in the idmapper X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=57a51048da742c764b6ce5d028c7f334ae04d363;p=linux-beck.git 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 Signed-off-by: Trond Myklebust --- 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, substring_t substr; int token, ret; - memset(im, 0, sizeof(*im)); - memset(msg, 0, sizeof(*msg)); - im->im_type = IDMAP_TYPE_GROUP; token = match_token(desc, nfs_idmap_tokens, &substr); @@ -677,7 +674,7 @@ static int nfs_idmap_legacy_upcall(struct key_construction *cons, int ret = -ENOMEM; /* msg and im are freed in idmap_pipe_destroy_msg */ - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) goto out1;