HID: provide a helper for validating hid reports
authorKees Cook <keescook@chromium.org>
Wed, 11 Sep 2013 19:56:50 +0000 (21:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2013 16:10:51 +0000 (09:10 -0700)
commit0049b62c9efc4ef23492976512d4722b3e63de45
treea098aec5808beb0937fdf3964e23742dd30066b2
parent62875332eafea9ee150a6037c0a1a20669e02aa1
HID: provide a helper for validating hid reports

commit 331415ff16a12147d57d5c953f3a961b7ede348b upstream.

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>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-core.c
include/linux/hid.h