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:11:42 +0000 (11:11 +0200)
commit7143f6cf58db8d41550c417d2ec0fb00d8c62caf
tree0af00b3da4499cd4d01f1ec7d3f6e3e32c37f50e
parentd8a76a2e514fbbb315a6dfff2d342de2de833994
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