diff options
author | Stefan Agner <stefan@agner.ch> | 2016-09-16 13:17:38 -0700 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2017-03-15 18:35:47 +0100 |
commit | 6819e8267b359913b95ccc822ac267454f39a460 (patch) | |
tree | 13ccc08839313536152b2c46fc9d3665c9e31db4 /drivers/hid/usbhid/hiddev.c | |
parent | 440ef98ad687b210dca17e5c5141b24738f04922 (diff) | |
parent | 3b60b86aec06fbae1142ccc4e55b39b529ae2a25 (diff) |
Merge tag 'v4.1.32' into toradex_vf_4.1-next
Linux 4.1.32
Diffstat (limited to 'drivers/hid/usbhid/hiddev.c')
-rw-r--r-- | drivers/hid/usbhid/hiddev.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 2f1ddca6f2e0..700145b15088 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -516,13 +516,13 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd, goto inval; } else if (uref->usage_index >= field->report_count) goto inval; - - else if ((cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) && - (uref_multi->num_values > HID_MAX_MULTI_USAGES || - uref->usage_index + uref_multi->num_values > field->report_count)) - goto inval; } + if ((cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) && + (uref_multi->num_values > HID_MAX_MULTI_USAGES || + uref->usage_index + uref_multi->num_values > field->report_count)) + goto inval; + switch (cmd) { case HIDIOCGUSAGE: uref->value = field->value[uref->usage_index]; |