Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: evdev - fix EVIOCSABS regression
  Input: evdev - fix Ooops in EVIOCGABS/EVIOCSABS
  • Loading branch information
torvalds committed Oct 18, 2010
2 parents 7f81c56 + f9ce6eb commit b0579fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,9 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,

if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCGABS(0))) {

if (!dev->absinfo)
return -EINVAL;

t = _IOC_NR(cmd) & ABS_MAX;
abs = dev->absinfo[t];

Expand All @@ -680,10 +683,13 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
}
}

if (_IOC_DIR(cmd) == _IOC_READ) {
if (_IOC_DIR(cmd) == _IOC_WRITE) {

if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0))) {

if (!dev->absinfo)
return -EINVAL;

t = _IOC_NR(cmd) & ABS_MAX;

if (copy_from_user(&abs, p, min_t(size_t,
Expand Down

0 comments on commit b0579fc

Please sign in to comment.