aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/evdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r--drivers/input/evdev.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 20e3a165989f..19c14c4beb44 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -160,6 +160,8 @@ struct input_event_compat {
160# define COMPAT_TEST IS_IA32_PROCESS(ia64_task_regs(current)) 160# define COMPAT_TEST IS_IA32_PROCESS(ia64_task_regs(current))
161#elif defined(CONFIG_ARCH_S390) 161#elif defined(CONFIG_ARCH_S390)
162# define COMPAT_TEST test_thread_flag(TIF_31BIT) 162# define COMPAT_TEST test_thread_flag(TIF_31BIT)
163#elif defined(CONFIG_MIPS)
164# define COMPAT_TEST (current->thread.mflags & MF_32BIT_ADDR)
163#else 165#else
164# define COMPAT_TEST test_thread_flag(TIF_32BIT) 166# define COMPAT_TEST test_thread_flag(TIF_32BIT)
165#endif 167#endif
@@ -391,6 +393,7 @@ static long evdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
391 case EV_LED: bits = dev->ledbit; len = LED_MAX; break; 393 case EV_LED: bits = dev->ledbit; len = LED_MAX; break;
392 case EV_SND: bits = dev->sndbit; len = SND_MAX; break; 394 case EV_SND: bits = dev->sndbit; len = SND_MAX; break;
393 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;
394 default: return -EINVAL; 397 default: return -EINVAL;
395 } 398 }
396 len = NBITS(len) * sizeof(long); 399 len = NBITS(len) * sizeof(long);
@@ -419,6 +422,13 @@ static long evdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
419 return copy_to_user(p, dev->snd, len) ? -EFAULT : len; 422 return copy_to_user(p, dev->snd, len) ? -EFAULT : len;
420 } 423 }
421 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
422 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0))) { 432 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0))) {
423 int len; 433 int len;
424 if (!dev->name) return -ENOENT; 434 if (!dev->name) return -ENOENT;