]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:24:33 +0000 (11:24 +0100)
commitcf0c335dba20449d09452c8ae9435db84ead78b3
tree6ce16d1b047e23e6588f88cddd70eed5d8064aaf
parent0d73b49c4037199472b29574ae21c21aef493971
HID: hid-lg4ff: Add check for empty lbuf

commit d180b6496143cd360c5d5f58ae4b9a8229c1f344 upstream.

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: f31a2de3fe36 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-lg4ff.c