diff options
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r-- | drivers/input/evdev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index f8b278d3559b..19c14c4beb44 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -393,6 +393,7 @@ static long evdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
393 | case EV_LED: bits = dev->ledbit; len = LED_MAX; break; | 393 | case EV_LED: bits = dev->ledbit; len = LED_MAX; break; |
394 | case EV_SND: bits = dev->sndbit; len = SND_MAX; break; | 394 | case EV_SND: bits = dev->sndbit; len = SND_MAX; break; |
395 | case EV_FF: bits = dev->ffbit; len = FF_MAX; break; | 395 | case EV_FF: bits = dev->ffbit; len = FF_MAX; break; |
396 | case EV_SW: bits = dev->swbit; len = SW_MAX; break; | ||
396 | default: return -EINVAL; | 397 | default: return -EINVAL; |
397 | } | 398 | } |
398 | len = NBITS(len) * sizeof(long); | 399 | len = NBITS(len) * sizeof(long); |
@@ -421,6 +422,13 @@ static long evdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
421 | return copy_to_user(p, dev->snd, len) ? -EFAULT : len; | 422 | return copy_to_user(p, dev->snd, len) ? -EFAULT : len; |
422 | } | 423 | } |
423 | 424 | ||
425 | if (_IOC_NR(cmd) == _IOC_NR(EVIOCGSW(0))) { | ||
426 | int len; | ||
427 | len = NBITS(SW_MAX) * sizeof(long); | ||
428 | if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd); | ||
429 | return copy_to_user(p, dev->sw, len) ? -EFAULT : len; | ||
430 | } | ||
431 | |||
424 | if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0))) { | 432 | if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0))) { |
425 | int len; | 433 | int len; |
426 | if (!dev->name) return -ENOENT; | 434 | if (!dev->name) return -ENOENT; |