HID: core: Fix size as type u32
authorAaron Ma <aaron.ma@canonical.com>
Mon, 8 Jan 2018 02:41:41 +0000 (10:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:34:12 +0000 (09:34 +0200)
commit4b43f4139e4054bc06a1f92be3018ebb6326f73f
tree8a3d8ed65ae02e788a5345c57189f699552d8c7d
parent10ab7c947d4921b962c7c2a6bffa2486d0cd127d
HID: core: Fix size as type u32

commit 6de0b13cc0b4ba10e98a9263d7a83b940720b77a upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-core.c
include/linux/hid.h