]> git.baikalelectronics.ru Git - kernel.git/commit
HID: hid-lg4ff: Add check for empty lbuf
authorAnastasia Belova <abelova@astralinux.ru>
Fri, 11 Nov 2022 12:55:11 +0000 (15:55 +0300)
committerJiri Kosina <jkosina@suse.cz>
Mon, 14 Nov 2022 22:56:52 +0000 (23:56 +0100)
commit7800d6b2ce89418a5e8df85c326596f4d41cc83d
treec892b4806ab23ca0f5ff58d1a0c90450056101b6
parent8f04554b1c0848b1cff43abee3cfb7ac9b17add6
HID: hid-lg4ff: Add check for empty lbuf

If an empty buf is received, lbuf is also empty. So lbuf is
accessed by index -1.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: bf2fb4c11b50 ("HID: hid-lg4ff: Allow switching of Logitech gaming wheels between compatibility modes")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-lg4ff.c