]> git.baikalelectronics.ru Git - kernel.git/commit
HID: core: Correctly handle ReportSize being zero
authorMarc Zyngier <maz@kernel.org>
Sat, 29 Aug 2020 11:26:01 +0000 (12:26 +0100)
committerBenjamin Tissoires <benjamin.tissoires@gmail.com>
Tue, 1 Sep 2020 08:25:49 +0000 (10:25 +0200)
commit274fe77d5c83c5c0525889efe7ff92974ef6cb57
treecf38d31f01ec5c2be9e38b39245e2b6bcc908b7c
parent1abffac4cdfacdafd98b3024273f57c6fda3fc18
HID: core: Correctly handle ReportSize being zero

It appears that a ReportSize value of zero is legal, even if a bit
non-sensical. Most of the HID code seems to handle that gracefully,
except when computing the total size in bytes. When fed as input to
memset, this leads to some funky outcomes.

Detect the corner case and correctly compute the size.

Cc: stable@vger.kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
drivers/hid/hid-core.c