diff options
Diffstat (limited to 'kernel/drivers/hid/usbhid/hiddev.c')
-rw-r--r-- | kernel/drivers/hid/usbhid/hiddev.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/drivers/hid/usbhid/hiddev.c b/kernel/drivers/hid/usbhid/hiddev.c index 2f1ddca6f..700145b15 100644 --- a/kernel/drivers/hid/usbhid/hiddev.c +++ b/kernel/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]; |