Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87541
b: refs/heads/master
c: c77990e
h: refs/heads/master
i:
  87539: a299e33
v: v3
  • Loading branch information
Cyrill Gorcunov authored and Mauro Carvalho Chehab committed Mar 20, 2008
1 parent 8e31e19 commit 29c34ad
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 77596058e1c2ad95b566dfdc926611a8dd820ee0
refs/heads/master: c77990e754af7443246f24ccb2336bbd62b01cc0
50 changes: 41 additions & 9 deletions trunk/drivers/media/video/v4l1-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_capability *cap = arg;

cap2 = kzalloc(sizeof(*cap2),GFP_KERNEL);
cap2 = kzalloc(sizeof(*cap2), GFP_KERNEL);
if (!cap2) {
err = -ENOMEM;
break;
}
memset(cap, 0, sizeof(*cap));
memset(&fbuf2, 0, sizeof(fbuf2));

Expand Down Expand Up @@ -426,7 +430,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_window *win = arg;

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
memset(win,0,sizeof(*win));

fmt2->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
Expand Down Expand Up @@ -464,7 +472,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
struct video_window *win = arg;
int err1,err2;

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
drv(inode, file, VIDIOC_STREAMOFF, &fmt2->type);
err1 = drv(inode, file, VIDIOC_G_FMT, fmt2);
Expand Down Expand Up @@ -586,6 +598,12 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_picture *pict = arg;

fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}

pict->brightness = get_v4l_control(inode, file,
V4L2_CID_BRIGHTNESS,drv);
pict->hue = get_v4l_control(inode, file,
Expand All @@ -597,7 +615,6 @@ v4l_compat_translate_ioctl(struct inode *inode,
pict->whiteness = get_v4l_control(inode, file,
V4L2_CID_WHITENESS, drv);

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
if (err < 0) {
Expand All @@ -617,6 +634,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
struct video_picture *pict = arg;
int mem_err = 0, ovl_err = 0;

fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
memset(&fbuf2, 0, sizeof(fbuf2));

set_v4l_control(inode, file,
Expand All @@ -636,7 +658,6 @@ v4l_compat_translate_ioctl(struct inode *inode,
* different pixel formats for memory vs overlay.
*/

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
/* If VIDIOC_G_FMT failed, then the driver likely doesn't
Expand Down Expand Up @@ -890,7 +911,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_mmap *mm = arg;

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
memset(&buf2,0,sizeof(buf2));

fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
Expand Down Expand Up @@ -986,7 +1011,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct vbi_format *fmt = arg;

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;

err = drv(inode, file, VIDIOC_G_FMT, fmt2);
Expand Down Expand Up @@ -1018,8 +1047,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
break;
}

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);

fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
fmt2->fmt.vbi.samples_per_line = fmt->samples_per_line;
fmt2->fmt.vbi.sampling_rate = fmt->sampling_rate;
Expand Down

0 comments on commit 29c34ad

Please sign in to comment.