diff options
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/meye.c | 4 | ||||
-rw-r--r-- | drivers/media/video/stk-webcam.c | 8 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 3 | ||||
-rw-r--r-- | drivers/media/video/v4l2-ioctl.c | 5 | ||||
-rw-r--r-- | drivers/media/video/zoran/zoran_driver.c | 7 |
5 files changed, 7 insertions, 20 deletions
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c index b76e33d..163fb2b 100644 --- a/drivers/media/video/meye.c +++ b/drivers/media/video/meye.c @@ -1446,10 +1446,6 @@ static int vidioc_querybuf(struct file *file, void *fh, struct v4l2_buffer *buf) if (index < 0 || index >= gbuffers) return -EINVAL; - memset(buf, 0, sizeof(*buf)); - - buf->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - buf->index = index; buf->bytesused = meye.grab_buffer[index].size; buf->flags = V4L2_BUF_FLAG_MAPPED; diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c index 26378cf..686720d 100644 --- a/drivers/media/video/stk-webcam.c +++ b/drivers/media/video/stk-webcam.c @@ -1139,16 +1139,10 @@ static int stk_vidioc_reqbufs(struct file *filp, static int stk_vidioc_querybuf(struct file *filp, void *priv, struct v4l2_buffer *buf) { - int index; struct stk_camera *dev = priv; struct stk_sio_buffer *sbuf; - if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) - return -EINVAL; - - index = buf->index; - - if (index < 0 || index >= dev->n_sbufs) + if (buf->index < 0 || buf->index >= dev->n_sbufs) return -EINVAL; sbuf = dev->sio_bufs + buf->index; *buf = sbuf->v4lbuf; diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index 33d79a5..863fcb31 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c @@ -788,9 +788,6 @@ static int vidioc_querybuf (struct file *file, /* FIXME : must control that buffers are mapped (VIDIOC_REQBUFS has been called) */ - if(vb->type != V4L2_CAP_VIDEO_CAPTURE) { - return -EINVAL; - } if(vb->index>=usbvision->num_frames) { return -EINVAL; } diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 20a571f..175688e 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c @@ -969,6 +969,11 @@ static long __video_do_ioctl(struct file *file, if (ret) break; + /* Zero out all fields starting with bytesysed, which is + * everything but index and type. */ + memset(0, &p->bytesused, + sizeof(*p) - offsetof(typeof(*p), bytesused)); + ret = ops->vidioc_querybuf(file, fh, p); if (!ret) dbgbuf(cmd, vfd, p); diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c index daad937..5dcd56c 100644 --- a/drivers/media/video/zoran/zoran_driver.c +++ b/drivers/media/video/zoran/zoran_driver.c @@ -2498,12 +2498,7 @@ static int zoran_querybuf(struct file *file, void *__fh, struct v4l2_buffer *buf { struct zoran_fh *fh = __fh; struct zoran *zr = fh->zr; - __u32 type = buf->type; - int index = buf->index, res; - - memset(buf, 0, sizeof(*buf)); - buf->type = type; - buf->index = index; + int res; mutex_lock(&zr->resource_lock); res = zoran_v4l2_buffer_status(file, buf, buf->index); |