]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: provide a helper for validating hid reports
authorKees Cook <keescook@chromium.org>
Wed, 11 Sep 2013 19:56:50 +0000 (21:56 +0200)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Mon, 10 Feb 2014 21:10:46 +0000 (16:10 -0500)
commit8e8f904083cd716a0244e89020b26a7346202a3b
treed7bfd3a4e874ef74a4c4b8a4bbf46182861c2569
parent88b152e6f128b050bc15e16d55c003994be352ce
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>
[PG: in 2.6.34 it is err_hid(), original baseline had hid_err().]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/hid/hid-core.c
include/linux/hid.h