]> git.itanic.dy.fi Git - linux-stable/commit
media: flexcop-usb: fix endpoint type check
authorJohan Hovold <johan@kernel.org>
Mon, 22 Aug 2022 15:10:27 +0000 (17:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:10:26 +0000 (11:10 +0200)
commitc5ee36018d320c16713711e68e13dbef4a31ffee
tree49185feb3119ccf99dee2f1e7b2b451f63cb4057
parent0d99b180ce68a691d835c8292bc260379f1e20ba
media: flexcop-usb: fix endpoint type check

commit 763679f0eeff0185fc431498849bbc1c24460875 upstream.

Commit d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint
type") tried to add an endpoint type sanity check for the single
isochronous endpoint but instead broke the driver by checking the wrong
descriptor or random data beyond the last endpoint descriptor.

Make sure to check the right endpoint descriptor.

Fixes: d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type")
Cc: Oliver Neukum <oneukum@suse.com>
Cc: stable@vger.kernel.org # 5.9
Reported-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20220822151027.27026-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/b2c2/flexcop-usb.c