Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267620
b: refs/heads/master
c: 71c9c20
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Meyer authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent 75090d8 commit a952c95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 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: a5232bde8449b28230f767e8b558021bb5d08e5c
refs/heads/master: 71c9c2045cc88f2253603bb7634c2eb523f20dea
30 changes: 10 additions & 20 deletions trunk/drivers/staging/easycap/easycap_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,17 +1317,12 @@ long easycap_unlocked_ioctl(struct file *file,
struct v4l2_control *pv4l2_control;

JOM(8, "VIDIOC_G_CTRL\n");
pv4l2_control = kzalloc(sizeof(struct v4l2_control), GFP_KERNEL);
if (!pv4l2_control) {
SAM("ERROR: out of memory\n");
pv4l2_control = memdup_user((void __user *)arg,
sizeof(struct v4l2_control));
if (IS_ERR(pv4l2_control)) {
SAM("ERROR: copy from user failed\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ENOMEM;
}
if (0 != copy_from_user(pv4l2_control, (void __user *)arg,
sizeof(struct v4l2_control))) {
kfree(pv4l2_control);
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
return PTR_ERR(pv4l2_control);
}

switch (pv4l2_control->id) {
Expand Down Expand Up @@ -2356,17 +2351,12 @@ long easycap_unlocked_ioctl(struct file *file,
struct v4l2_streamparm *pv4l2_streamparm;

JOM(8, "VIDIOC_G_PARM\n");
pv4l2_streamparm = kzalloc(sizeof(struct v4l2_streamparm), GFP_KERNEL);
if (!pv4l2_streamparm) {
SAM("ERROR: out of memory\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ENOMEM;
}
if (copy_from_user(pv4l2_streamparm,
(void __user *)arg, sizeof(struct v4l2_streamparm))) {
kfree(pv4l2_streamparm);
pv4l2_streamparm = memdup_user((void __user *)arg,
sizeof(struct v4l2_streamparm));
if (IS_ERR(pv4l2_streamparm)) {
SAM("ERROR: copy from user failed\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
return PTR_ERR(pv4l2_streamparm);
}

if (pv4l2_streamparm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
Expand Down

0 comments on commit a952c95

Please sign in to comment.