HID: core: prevent out-of-bound readings
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Tue, 19 Jan 2016 11:34:58 +0000 (12:34 +0100)
committerJiri Kosina <jkosina@suse.cz>
Tue, 19 Jan 2016 13:09:34 +0000 (14:09 +0100)
commit50220dead1650609206efe91f0cc116132d59b3f
tree4310293cab681fe0072c600d32c83ca061c18c01
parent5137b354bc8a5c04edb10d83f8bdb0bf8896fd68
HID: core: prevent out-of-bound readings

Plugging a Logitech DJ receiver with KASAN activated raises a bunch of
out-of-bound readings.

The fields are allocated up to MAX_USAGE, meaning that potentially, we do
not have enough fields to fit the incoming values.
Add checks and silence KASAN.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-core.c