diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-01-11 16:40:56 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-11 16:40:56 -0500 |
commit | 7408187d223f63d46a13b6a35b8f96b032c2f623 (patch) | |
tree | 425a459f760295de488f57e3f97b034aaa76a78d /drivers/media/common/saa7146_fops.c | |
parent | 0b3af1b6df82cfdb54ae294ed860263011fa0408 (diff) |
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 <takis@issaris.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/common/saa7146_fops.c')
-rw-r--r-- | drivers/media/common/saa7146_fops.c | 6 |
1 files changed, 2 insertions, 4 deletions
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) | |||
239 | } | 239 | } |
240 | 240 | ||
241 | /* allocate per open data */ | 241 | /* allocate per open data */ |
242 | fh = kmalloc(sizeof(*fh),GFP_KERNEL); | 242 | fh = kzalloc(sizeof(*fh),GFP_KERNEL); |
243 | if (NULL == fh) { | 243 | if (NULL == fh) { |
244 | DEB_S(("cannot allocate memory for per open data.\n")); | 244 | DEB_S(("cannot allocate memory for per open data.\n")); |
245 | result = -ENOMEM; | 245 | result = -ENOMEM; |
246 | goto out; | 246 | goto out; |
247 | } | 247 | } |
248 | memset(fh,0,sizeof(*fh)); | ||
249 | 248 | ||
250 | file->private_data = fh; | 249 | file->private_data = fh; |
251 | fh->dev = dev; | 250 | fh->dev = dev; |
@@ -464,12 +463,11 @@ static struct video_device device_template = | |||
464 | 463 | ||
465 | int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) | 464 | int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) |
466 | { | 465 | { |
467 | struct saa7146_vv *vv = kmalloc (sizeof(struct saa7146_vv),GFP_KERNEL); | 466 | struct saa7146_vv *vv = kzalloc (sizeof(struct saa7146_vv),GFP_KERNEL); |
468 | if( NULL == vv ) { | 467 | if( NULL == vv ) { |
469 | ERR(("out of memory. aborting.\n")); | 468 | ERR(("out of memory. aborting.\n")); |
470 | return -1; | 469 | return -1; |
471 | } | 470 | } |
472 | memset(vv, 0x0, sizeof(*vv)); | ||
473 | 471 | ||
474 | DEB_EE(("dev:%p\n",dev)); | 472 | DEB_EE(("dev:%p\n",dev)); |
475 | 473 | ||