From 7408187d223f63d46a13b6a35b8f96b032c2f623 Mon Sep 17 00:00:00 2001 From: Panagiotis Issaris Date: Wed, 11 Jan 2006 19:40:56 -0200 Subject: V4L/DVB (3344a): Conversions from kmalloc+memset to k(z|c)alloc Conversions from kmalloc+memset to k(z|c)alloc. Signed-off-by: Panagiotis Issaris Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/common/saa7146_fops.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/media/common/saa7146_fops.c') diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c index b614612be7b4..f8cf73ed49ad 100644 --- a/drivers/media/common/saa7146_fops.c +++ b/drivers/media/common/saa7146_fops.c @@ -239,13 +239,12 @@ static int fops_open(struct inode *inode, struct file *file) } /* allocate per open data */ - fh = kmalloc(sizeof(*fh),GFP_KERNEL); + fh = kzalloc(sizeof(*fh),GFP_KERNEL); if (NULL == fh) { DEB_S(("cannot allocate memory for per open data.\n")); result = -ENOMEM; goto out; } - memset(fh,0,sizeof(*fh)); file->private_data = fh; fh->dev = dev; @@ -464,12 +463,11 @@ static struct video_device device_template = int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) { - struct saa7146_vv *vv = kmalloc (sizeof(struct saa7146_vv),GFP_KERNEL); + struct saa7146_vv *vv = kzalloc (sizeof(struct saa7146_vv),GFP_KERNEL); if( NULL == vv ) { ERR(("out of memory. aborting.\n")); return -1; } - memset(vv, 0x0, sizeof(*vv)); DEB_EE(("dev:%p\n",dev)); -- cgit v1.2.2