aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-01-19 22:03:32 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:34:37 -0500
commit4b85dee6a05dd963a13bd1230fafc060bf45ae45 (patch)
tree531246264f3e7786fe57347a7ad6ebbed427ddf2 /drivers/media/video/pvrusb2
parent6710fb868b289d21139bd68262388e0ea34601eb (diff)
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')
-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)
914 return -EIO; 914 return -EIO;
915 } 915 }
916 916
917 fhp = kmalloc(sizeof(*fhp),GFP_KERNEL); 917 fhp = kzalloc(sizeof(*fhp),GFP_KERNEL);
918 if (!fhp) { 918 if (!fhp) {
919 return -ENOMEM; 919 return -ENOMEM;
920 } 920 }
921 memset(fhp,0,sizeof(*fhp));
922 921
923 init_waitqueue_head(&fhp->wait_data); 922 init_waitqueue_head(&fhp->wait_data);
924 fhp->dev_info = dip; 923 fhp->dev_info = dip;
@@ -1183,19 +1182,16 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp)
1183{ 1182{
1184 struct pvr2_v4l2 *vp; 1183 struct pvr2_v4l2 *vp;
1185 1184
1186 vp = kmalloc(sizeof(*vp),GFP_KERNEL); 1185 vp = kzalloc(sizeof(*vp),GFP_KERNEL);
1187 if (!vp) return vp; 1186 if (!vp) return vp;
1188 memset(vp,0,sizeof(*vp)); 1187 vp->dev_video = kzalloc(sizeof(*vp->dev_video),GFP_KERNEL);
1189 vp->dev_video = kmalloc(sizeof(*vp->dev_video),GFP_KERNEL); 1188 vp->dev_radio = kzalloc(sizeof(*vp->dev_radio),GFP_KERNEL);
1190 vp->dev_radio = kmalloc(sizeof(*vp->dev_radio),GFP_KERNEL);
1191 if (!(vp->dev_video && vp->dev_radio)) { 1189 if (!(vp->dev_video && vp->dev_radio)) {
1192 kfree(vp->dev_video); 1190 kfree(vp->dev_video);
1193 kfree(vp->dev_radio); 1191 kfree(vp->dev_radio);
1194 kfree(vp); 1192 kfree(vp);
1195 return NULL; 1193 return NULL;
1196 } 1194 }
1197 memset(vp->dev_video,0,sizeof(*vp->dev_video));
1198 memset(vp->dev_radio,0,sizeof(*vp->dev_radio));
1199 pvr2_channel_init(&vp->channel,mnp); 1195 pvr2_channel_init(&vp->channel,mnp);
1200 pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_v4l2 id=%p",vp); 1196 pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_v4l2 id=%p",vp);
1201 1197