Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248532
b: refs/heads/master
c: dd2ed48
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Mack authored and Jiri Kosina committed May 18, 2011
1 parent 90bd1f1 commit 91cc812
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 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: 8c4e708d01424f88afde64a96ffd05146c9978b8
refs/heads/master: dd2ed487fdd78b50549b2ca8418875c0d9f4a30e
14 changes: 2 additions & 12 deletions trunk/drivers/hid/hidraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,7 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
}

if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWNAME(0))) {
int len;
if (!hid->name) {
ret = 0;
break;
}
len = strlen(hid->name) + 1;
int len = strlen(hid->name) + 1;
if (len > _IOC_SIZE(cmd))
len = _IOC_SIZE(cmd);
ret = copy_to_user(user_arg, hid->name, len) ?
Expand All @@ -409,12 +404,7 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
}

if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWPHYS(0))) {
int len;
if (!hid->phys) {
ret = 0;
break;
}
len = strlen(hid->phys) + 1;
int len = strlen(hid->phys) + 1;
if (len > _IOC_SIZE(cmd))
len = _IOC_SIZE(cmd);
ret = copy_to_user(user_arg, hid->phys, len) ?
Expand Down
18 changes: 2 additions & 16 deletions trunk/drivers/hid/usbhid/hiddev.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,14 +801,7 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break;

if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGNAME(0))) {
int len;

if (!hid->name) {
r = 0;
break;
}

len = strlen(hid->name) + 1;
int len = strlen(hid->name) + 1;
if (len > _IOC_SIZE(cmd))
len = _IOC_SIZE(cmd);
r = copy_to_user(user_arg, hid->name, len) ?
Expand All @@ -817,14 +810,7 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
}

if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGPHYS(0))) {
int len;

if (!hid->phys) {
r = 0;
break;
}

len = strlen(hid->phys) + 1;
int len = strlen(hid->phys) + 1;
if (len > _IOC_SIZE(cmd))
len = _IOC_SIZE(cmd);
r = copy_to_user(user_arg, hid->phys, len) ?
Expand Down

0 comments on commit 91cc812

Please sign in to comment.