Patchwork [18/49] drivers/net/cxgb4: Use vzalloc

login
register
mail settings
Submitter Joe Perches
Date Nov. 5, 2010, 3:07 a.m.
Message ID <e208320e90dc0d7e77686cf8bf8131553f7a7b6e.1288925424.git.joe@perches.com>
Download mbox | patch
Permalink /patch/70229/
State Deferred
Delegated to: David Miller
Headers show

Comments

Joe Perches - Nov. 5, 2010, 3:07 a.m.
Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/cxgb4/cxgb4_main.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index f17703f..b7758ce 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -868,12 +868,11 @@  out:	release_firmware(fw);
  */
 void *t4_alloc_mem(size_t size)
 {
-	void *p = kmalloc(size, GFP_KERNEL);
+	void *p = kzalloc(size, GFP_KERNEL);
 
 	if (!p)
-		p = vmalloc(size);
-	if (p)
-		memset(p, 0, size);
+		p = vzalloc(size);
+
 	return p;
 }