Unverified Commit 2aaf1a60 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12792 HID: core: fix shift-out-of-bounds in hid_report_raw_event

parents 3437d157 ef18921b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1122,6 +1122,9 @@ EXPORT_SYMBOL_GPL(hid_open_report);

static s32 snto32(__u32 value, unsigned n)
{
	if (n > 32)
		n = 32;

	switch (n) {
	case 8:  return ((__s8)value);
	case 16: return ((__s16)value);