Thread (2 messages) 2 messages, 2 authors, 2007-04-16

[KJ] [PATCH]vfc_dev.c-kzalloc

From: <hidden>
Date: 2007-04-16 06:17:28
Also in: kernel-janitors
Subsystem: sparc + ultrasparc (sparc/sparc64), the rest · Maintainers: "David S. Miller", Andreas Larsson, Linus Torvalds

Replacing kmalloc/memset combination with kzalloc.

Signed-off-by: vignesh babu <redacted>
---
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c
index 8bfb67c..c3135e2 100644
--- a/drivers/sbus/char/vfc_dev.c
+++ b/drivers/sbus/char/vfc_dev.c
@@ -259,11 +259,10 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, void __user *argp)
 		if (copy_from_user(&inout, argp, sizeof(inout)))
 			return -EFAULT;
 
-		buffer = kmalloc(inout.len, GFP_KERNEL);
+		buffer = kzalloc(inout.len, GFP_KERNEL);
 		if (buffer == NULL)
 			return -ENOMEM;
 
-		memset(buffer,0,inout.len);
 		vfc_lock_device(dev);
 		inout.ret=
 			vfc_i2c_recvbuf(dev,inout.addr & 0xff
-- 
Regards,  
Vignesh Babu BM  
_____________________________________________________________  
"Why is it that every time I'm with you, makes me believe in magic?"
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help