summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-01-20 04:03:32 +0100
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 16:34:37 +0100
commit4b85dee6a05dd963a13bd1230fafc060bf45ae45 (patch)
tree531246264f3e7786fe57347a7ad6ebbed427ddf2 /drivers/media/video/pvrusb2/pvrusb2-v4l2.c
parentV4L/DVB (5078): Pvrusb2: It's safe to kfree() a null pointer (diff)
downloadlinux-4b85dee6a05dd963a13bd1230fafc060bf45ae45.tar.xz
linux-4b85dee6a05dd963a13bd1230fafc060bf45ae45.zip
V4L/DVB (5079): Pvrusb2: Use kzalloc instead of kmalloc+memset pairs
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-v4l2.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 4c2e4defd71e..9890c753cf55 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -914,11 +914,10 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
return -EIO;
}
- fhp = kmalloc(sizeof(*fhp),GFP_KERNEL);
+ fhp = kzalloc(sizeof(*fhp),GFP_KERNEL);
if (!fhp) {
return -ENOMEM;
}
- memset(fhp,0,sizeof(*fhp));
init_waitqueue_head(&fhp->wait_data);
fhp->dev_info = dip;
@@ -1183,19 +1182,16 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp)
{
struct pvr2_v4l2 *vp;
- vp = kmalloc(sizeof(*vp),GFP_KERNEL);
+ vp = kzalloc(sizeof(*vp),GFP_KERNEL);
if (!vp) return vp;
- memset(vp,0,sizeof(*vp));
- vp->dev_video = kmalloc(sizeof(*vp->dev_video),GFP_KERNEL);
- vp->dev_radio = kmalloc(sizeof(*vp->dev_radio),GFP_KERNEL);
+ vp->dev_video = kzalloc(sizeof(*vp->dev_video),GFP_KERNEL);
+ vp->dev_radio = kzalloc(sizeof(*vp->dev_radio),GFP_KERNEL);
if (!(vp->dev_video && vp->dev_radio)) {
kfree(vp->dev_video);
kfree(vp->dev_radio);
kfree(vp);
return NULL;
}
- memset(vp->dev_video,0,sizeof(*vp->dev_video));
- memset(vp->dev_radio,0,sizeof(*vp->dev_radio));
pvr2_channel_init(&vp->channel,mnp);
pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_v4l2 id=%p",vp);