All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 6/7] dlm: use kzalloc
Date: Thu, 19 Jan 2006 15:31:01 -0600	[thread overview]
Message-ID: <20060119213100.GF31387@redhat.com> (raw)

Use kzalloc.

Signed-off-by: David Teigland <teigland@redhat.com>

Index: linux/drivers/dlm/device.c
===================================================================
--- linux.orig/drivers/dlm/device.c	2006-01-19 13:38:38.978178974 -0600
+++ linux/drivers/dlm/device.c	2006-01-19 13:38:54.847754011 -0600
@@ -236,12 +236,11 @@
 
 	namelen = strlen(name)+strlen(name_prefix)+2;
 
-	newls = kmalloc(sizeof(struct user_ls), GFP_KERNEL);
+	newls = kzalloc(sizeof(struct user_ls), GFP_KERNEL);
 	if (!newls)
 		return -ENOMEM;
-	memset(newls, 0, sizeof(struct user_ls));
 
-	newls->ls_miscinfo.name = kmalloc(namelen, GFP_KERNEL);
+	newls->ls_miscinfo.name = kzalloc(namelen, GFP_KERNEL);
 	if (!newls->ls_miscinfo.name) {
 		kfree(newls);
 		return -ENOMEM;
@@ -306,11 +305,10 @@
 static void add_to_astqueue(struct lock_info *li, void *astaddr, void *astparam,
 			    int lvb_updated)
 {
-	struct ast_info *ast = kmalloc(sizeof(struct ast_info), GFP_KERNEL);
+	struct ast_info *ast = kzalloc(sizeof(struct ast_info), GFP_KERNEL);
 	if (!ast)
 		return;
 
-	memset(ast, 0, sizeof(*ast));
 	ast->result.user_astparam = astparam;
 	ast->result.user_astaddr  = astaddr;
 	ast->result.user_lksb     = li->li_user_lksb;
@@ -439,7 +437,7 @@
 	if (!lsinfo)
 		return -ENOENT;
 
-	f = kmalloc(sizeof(struct file_info), GFP_KERNEL);
+	f = kzalloc(sizeof(struct file_info), GFP_KERNEL);
 	if (!f)
 		return -ENOMEM;
 
@@ -754,7 +752,7 @@
 	if (!try_module_get(THIS_MODULE))
 		return NULL;
 
-	li = kmalloc(sizeof(struct lock_info), GFP_KERNEL);
+	li = kzalloc(sizeof(struct lock_info), GFP_KERNEL);
 	if (li) {
 		li->li_magic     = LOCKINFO_MAGIC;
 		li->li_file      = fi;
Index: linux/drivers/dlm/lockspace.c
===================================================================
--- linux.orig/drivers/dlm/lockspace.c	2006-01-19 10:06:23.000000000 -0600
+++ linux/drivers/dlm/lockspace.c	2006-01-19 13:38:54.848753858 -0600
@@ -351,10 +351,9 @@
 		return -EEXIST;
 	}
 
-	ls = kmalloc(sizeof(struct dlm_ls) + namelen, GFP_KERNEL);
+	ls = kzalloc(sizeof(struct dlm_ls) + namelen, GFP_KERNEL);
 	if (!ls)
 		goto out;
-	memset(ls, 0, sizeof(struct dlm_ls) + namelen);
 	memcpy(ls->ls_name, name, namelen);
 	ls->ls_namelen = namelen;
 	ls->ls_exflags = flags;
Index: linux/drivers/dlm/member.c
===================================================================
--- linux.orig/drivers/dlm/member.c	2006-01-19 13:38:44.615317587 -0600
+++ linux/drivers/dlm/member.c	2006-01-19 13:38:54.848753858 -0600
@@ -52,7 +52,7 @@
 	struct dlm_member *memb;
 	int w;
 
-	memb = kmalloc(sizeof(struct dlm_member), GFP_KERNEL);
+	memb = kzalloc(sizeof(struct dlm_member), GFP_KERNEL);
 	if (!memb)
 		return -ENOMEM;
 
@@ -271,10 +271,9 @@
 	int *ids = NULL;
 	int error, count;
 
-	rv = kmalloc(sizeof(struct dlm_recover), GFP_KERNEL);
+	rv = kzalloc(sizeof(struct dlm_recover), GFP_KERNEL);
 	if (!rv)
 		return -ENOMEM;
-	memset(rv, 0, sizeof(struct dlm_recover));
 
 	error = count = dlm_nodeid_list(ls->ls_name, &ids);
 	if (error <= 0)

                 reply	other threads:[~2006-01-19 21:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060119213100.GF31387@redhat.com \
    --to=teigland@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.