HID: provide a helper for validating hid reports
authorKees Cook <keescook@chromium.org>
Wed, 11 Sep 2013 19:56:50 +0000 (21:56 +0200)
committerJiri Kosina <jkosina@suse.cz>
Fri, 13 Sep 2013 13:11:21 +0000 (15:11 +0200)
commit331415ff16a12147d57d5c953f3a961b7ede348b
tree79a497ffd03b720215e567c9c9862090fc76d0fa
parentb04c99e3b845892d754ee8052d6324c39c4040de
HID: provide a helper for validating hid reports

Many drivers need to validate the characteristics of their HID report
during initialization to avoid misusing the reports. This adds a common
helper to perform validation of the report exisitng, the field existing,
and the expected number of values within the field.

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-core.c
include/linux/hid.h