Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189933
b: refs/heads/master
c: 9cac00b
h: refs/heads/master
i:
  189931: 3c5e27a
v: v3
  • Loading branch information
Stefan Richter committed Apr 10, 2010
1 parent 0dcadb1 commit 1ddc8d2
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 385ab5bcd4be586dffdba550b310308d89eade71
refs/heads/master: 9cac00b8f0079d5d3d54ec4dae453d58dec30e7c
18 changes: 9 additions & 9 deletions trunk/drivers/firewire/core-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1356,24 +1356,24 @@ static int dispatch_ioctl(struct client *client,
return -ENODEV;

if (_IOC_TYPE(cmd) != '#' ||
_IOC_NR(cmd) >= ARRAY_SIZE(ioctl_handlers))
_IOC_NR(cmd) >= ARRAY_SIZE(ioctl_handlers) ||
_IOC_SIZE(cmd) > sizeof(buffer))
return -EINVAL;

if (_IOC_DIR(cmd) & _IOC_WRITE) {
if (_IOC_SIZE(cmd) > sizeof(buffer) ||
copy_from_user(&buffer, arg, _IOC_SIZE(cmd)))
if (_IOC_DIR(cmd) == _IOC_READ)
memset(&buffer, 0, _IOC_SIZE(cmd));

if (_IOC_DIR(cmd) & _IOC_WRITE)
if (copy_from_user(&buffer, arg, _IOC_SIZE(cmd)))
return -EFAULT;
}

ret = ioctl_handlers[_IOC_NR(cmd)](client, &buffer);
if (ret < 0)
return ret;

if (_IOC_DIR(cmd) & _IOC_READ) {
if (_IOC_SIZE(cmd) > sizeof(buffer) ||
copy_to_user(arg, &buffer, _IOC_SIZE(cmd)))
if (_IOC_DIR(cmd) & _IOC_READ)
if (copy_to_user(arg, &buffer, _IOC_SIZE(cmd)))
return -EFAULT;
}

return ret;
}
Expand Down

0 comments on commit 1ddc8d2

Please sign in to comment.