diff options
Diffstat (limited to 'drivers/media/video/v4l1-compat.c')
-rw-r--r-- | drivers/media/video/v4l1-compat.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c index 2ab5b4093800..474a29bc1760 100644 --- a/drivers/media/video/v4l1-compat.c +++ b/drivers/media/video/v4l1-compat.c | |||
@@ -305,9 +305,8 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
305 | { | 305 | { |
306 | struct video_capability *cap = arg; | 306 | struct video_capability *cap = arg; |
307 | 307 | ||
308 | cap2 = kmalloc(sizeof(*cap2),GFP_KERNEL); | 308 | cap2 = kzalloc(sizeof(*cap2),GFP_KERNEL); |
309 | memset(cap, 0, sizeof(*cap)); | 309 | memset(cap, 0, sizeof(*cap)); |
310 | memset(cap2, 0, sizeof(*cap2)); | ||
311 | memset(&fbuf2, 0, sizeof(fbuf2)); | 310 | memset(&fbuf2, 0, sizeof(fbuf2)); |
312 | 311 | ||
313 | err = drv(inode, file, VIDIOC_QUERYCAP, cap2); | 312 | err = drv(inode, file, VIDIOC_QUERYCAP, cap2); |
@@ -422,9 +421,8 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
422 | { | 421 | { |
423 | struct video_window *win = arg; | 422 | struct video_window *win = arg; |
424 | 423 | ||
425 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 424 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
426 | memset(win,0,sizeof(*win)); | 425 | memset(win,0,sizeof(*win)); |
427 | memset(fmt2,0,sizeof(*fmt2)); | ||
428 | 426 | ||
429 | fmt2->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; | 427 | fmt2->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; |
430 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); | 428 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); |
@@ -461,8 +459,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
461 | struct video_window *win = arg; | 459 | struct video_window *win = arg; |
462 | int err1,err2; | 460 | int err1,err2; |
463 | 461 | ||
464 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 462 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
465 | memset(fmt2,0,sizeof(*fmt2)); | ||
466 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 463 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
467 | drv(inode, file, VIDIOC_STREAMOFF, &fmt2->type); | 464 | drv(inode, file, VIDIOC_STREAMOFF, &fmt2->type); |
468 | err1 = drv(inode, file, VIDIOC_G_FMT, fmt2); | 465 | err1 = drv(inode, file, VIDIOC_G_FMT, fmt2); |
@@ -595,8 +592,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
595 | pict->whiteness = get_v4l_control(inode, file, | 592 | pict->whiteness = get_v4l_control(inode, file, |
596 | V4L2_CID_WHITENESS, drv); | 593 | V4L2_CID_WHITENESS, drv); |
597 | 594 | ||
598 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 595 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
599 | memset(fmt2,0,sizeof(*fmt2)); | ||
600 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 596 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
601 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); | 597 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); |
602 | if (err < 0) { | 598 | if (err < 0) { |
@@ -622,8 +618,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
622 | set_v4l_control(inode, file, | 618 | set_v4l_control(inode, file, |
623 | V4L2_CID_WHITENESS, pict->whiteness, drv); | 619 | V4L2_CID_WHITENESS, pict->whiteness, drv); |
624 | 620 | ||
625 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 621 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
626 | memset(fmt2,0,sizeof(*fmt2)); | ||
627 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 622 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
628 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); | 623 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); |
629 | if (err < 0) | 624 | if (err < 0) |
@@ -846,9 +841,8 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
846 | { | 841 | { |
847 | struct video_mmap *mm = arg; | 842 | struct video_mmap *mm = arg; |
848 | 843 | ||
849 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 844 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
850 | memset(&buf2,0,sizeof(buf2)); | 845 | memset(&buf2,0,sizeof(buf2)); |
851 | memset(fmt2,0,sizeof(*fmt2)); | ||
852 | 846 | ||
853 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 847 | fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
854 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); | 848 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); |
@@ -942,8 +936,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
942 | { | 936 | { |
943 | struct vbi_format *fmt = arg; | 937 | struct vbi_format *fmt = arg; |
944 | 938 | ||
945 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 939 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
946 | memset(fmt2, 0, sizeof(*fmt2)); | ||
947 | fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE; | 940 | fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE; |
948 | 941 | ||
949 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); | 942 | err = drv(inode, file, VIDIOC_G_FMT, fmt2); |
@@ -975,8 +968,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
975 | break; | 968 | break; |
976 | } | 969 | } |
977 | 970 | ||
978 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 971 | fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL); |
979 | memset(fmt2, 0, sizeof(*fmt2)); | ||
980 | 972 | ||
981 | fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE; | 973 | fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE; |
982 | fmt2->fmt.vbi.samples_per_line = fmt->samples_per_line; | 974 | fmt2->fmt.vbi.samples_per_line = fmt->samples_per_line; |