Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138042
b: refs/heads/master
c: 337f9d2
h: refs/heads/master
v: v3
  • Loading branch information
Trent Piepho authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent a35d048 commit d893735
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 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: 19c96e4b7d3c80071982a052e4a921c1a39875d9
refs/heads/master: 337f9d205972bfe1cb7982384fd0f4caa4af001d
20 changes: 5 additions & 15 deletions trunk/drivers/media/video/v4l2-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,6 @@ static long __video_do_ioctl(struct file *file,
if (cmd == VIDIOCGMBUF) {
struct video_mbuf *p = arg;

memset(p, 0, sizeof(*p));

if (!ops->vidiocgmbuf)
return ret;
ret = ops->vidiocgmbuf(file, fh, p);
Expand All @@ -683,7 +681,6 @@ static long __video_do_ioctl(struct file *file,
case VIDIOC_QUERYCAP:
{
struct v4l2_capability *cap = (struct v4l2_capability *)arg;
memset(cap, 0, sizeof(*cap));

if (!ops->vidioc_querycap)
break;
Expand Down Expand Up @@ -1367,7 +1364,6 @@ static long __video_do_ioctl(struct file *file,
if (!ops->vidioc_g_audio)
break;

memset(p, 0, sizeof(*p));
ret = ops->vidioc_g_audio(file, fh, p);
if (!ret)
dbgarg(cmd, "index=%d, name=%s, capability=0x%x, "
Expand Down Expand Up @@ -1409,7 +1405,7 @@ static long __video_do_ioctl(struct file *file,

if (!ops->vidioc_g_audout)
break;
dbgarg(cmd, "Enum for index=%d\n", p->index);

ret = ops->vidioc_g_audout(file, fh, p);
if (!ret)
dbgarg2("index=%d, name=%s, capability=%d, "
Expand Down Expand Up @@ -1506,8 +1502,6 @@ static long __video_do_ioctl(struct file *file,
if (!ops->vidioc_g_jpegcomp)
break;

memset(p, 0, sizeof(*p));

ret = ops->vidioc_g_jpegcomp(file, fh, p);
if (!ret)
dbgarg(cmd, "quality=%d, APPn=%d, "
Expand Down Expand Up @@ -1873,13 +1867,7 @@ long video_ioctl2(struct file *file,
cmd == VIDIOC_TRY_EXT_CTRLS);

/* Copy arguments into temp kernel buffer */
switch (_IOC_DIR(cmd)) {
case _IOC_NONE:
parg = NULL;
break;
case _IOC_READ:
case _IOC_WRITE:
case (_IOC_WRITE | _IOC_READ):
if (_IOC_DIR(cmd) != _IOC_NONE) {
if (_IOC_SIZE(cmd) <= sizeof(sbuf)) {
parg = sbuf;
} else {
Expand All @@ -1900,8 +1888,10 @@ long video_ioctl2(struct file *file,
/* zero out anything we don't copy from userspace */
if (n < _IOC_SIZE(cmd))
memset((u8 *)parg + n, 0, _IOC_SIZE(cmd) - n);
} else {
/* read-only ioctl */
memset(parg, 0, _IOC_SIZE(cmd));
}
break;
}

if (is_ext_ctrl) {
Expand Down

0 comments on commit d893735

Please sign in to comment.