netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] xfrm_hash: kmalloc + memset conversion to kzalloc
@ 2007-11-26  9:02 Joonwoo Park
  2007-11-26  9:06 ` Robert P. J. Day
  2007-11-26  9:10 ` Patrick McHardy
  0 siblings, 2 replies; 6+ messages in thread
From: Joonwoo Park @ 2007-11-26  9:02 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel

xfrm_hash: kmalloc + memset conversion to kzalloc

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>

Thanks.
Joonwoo

---
diff --git a/net/xfrm/xfrm_hash.c b/net/xfrm/xfrm_hash.c
index 55ab579..37795bd 100644
--- a/net/xfrm/xfrm_hash.c
+++ b/net/xfrm/xfrm_hash.c
@@ -17,16 +17,17 @@ struct hlist_head *xfrm_hash_alloc(unsigned int sz)
 	struct hlist_head *n;
 
 	if (sz <= PAGE_SIZE)
-		n = kmalloc(sz, GFP_KERNEL);
-	else if (hashdist)
-		n = __vmalloc(sz, GFP_KERNEL, PAGE_KERNEL);
-	else
-		n = (struct hlist_head *)
-			__get_free_pages(GFP_KERNEL | __GFP_NOWARN,
-					 get_order(sz));
-
-	if (n)
-		memset(n, 0, sz);
+		n = kzalloc(sz, GFP_KERNEL);
+	else {
+		if (hashdist)
+			n = __vmalloc(sz, GFP_KERNEL, PAGE_KERNEL);
+		else
+			n = (struct hlist_head *)
+				__get_free_pages(GFP_KERNEL | __GFP_NOWARN,
+						 get_order(sz));
+		if (n)
+			memset(n, 0, sz);
+	}
 
 	return n;
 }
---


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-11-26 15:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-26  9:02 [PATCH 1/4] xfrm_hash: kmalloc + memset conversion to kzalloc Joonwoo Park
2007-11-26  9:06 ` Robert P. J. Day
2007-11-26 10:28   ` Joonwoo Park
2007-11-26  9:10 ` Patrick McHardy
2007-11-26 10:23   ` Joonwoo Park
2007-11-26 15:24     ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).