Patchwork [2/4] hvc_console: use kzalloc

login
register
mail settings
Submitter Milton Miller
Date Jan. 8, 2009, 12:14 p.m.
Message ID <hvc-console-29-3-2@bga.com>
Download mbox | patch
Permalink /patch/17340/
State Accepted
Commit 2da7582f7cf5ef5e6adcf42537b6b8be06312152
Headers show

Comments

Milton Miller - Jan. 8, 2009, 12:14 p.m.
Replace kmalloc + memset  with kzalloc.

Signed-off-by: Milton Miller <miltonm@bga.com>

Patch

Index: work.git/drivers/char/hvc_console.c
===================================================================
--- work.git.orig/drivers/char/hvc_console.c	2009-01-08 04:24:10.000000000 -0600
+++ work.git/drivers/char/hvc_console.c	2009-01-08 04:24:35.000000000 -0600
@@ -765,13 +765,11 @@  struct hvc_struct __devinit *hvc_alloc(u
 			return ERR_PTR(err);
 	}
 
-	hp = kmalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size,
+	hp = kzalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size,
 			GFP_KERNEL);
 	if (!hp)
 		return ERR_PTR(-ENOMEM);
 
-	memset(hp, 0x00, sizeof(*hp));
-
 	hp->vtermno = vtermno;
 	hp->data = data;
 	hp->ops = ops;