]> www.infradead.org Git - users/dwmw2/linux.git/commit
HID: core: Fix size as type u32
authorAaron Ma <aaron.ma@canonical.com>
Mon, 8 Jan 2018 02:41:41 +0000 (10:41 +0800)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:36:33 +0000 (21:36 -0400)
commit0f97219d779a39c85843b69f13cdfc81a457a059
treeafd5c9b04cb28d9d781709b62b01594de4c4b5d5
parentaf8dd966f24f0dca977ca4070d8e6ee9f5c9a1f5
HID: core: Fix size as type u32

[ Upstream commit 6de0b13cc0b4ba10e98a9263d7a83b940720b77a ]

When size is negative, calling memset will make segment fault.
Declare the size as type u32 to keep memset safe.

size in struct hid_report is unsigned, fix return type of
hid_report_len to u32.

Cc: stable@vger.kernel.org
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/hid/hid-core.c
include/linux/hid.h