media: flexcop-usb: fix endpoint type check
commit763679f0eeupstream. Commitd725d20e81("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:d725d20e81("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>
This commit is contained in:
parent
0d99b180ce
commit
c5ee36018d
1 changed files with 1 additions and 1 deletions
|
|
@ -512,7 +512,7 @@ static int flexcop_usb_init(struct flexcop_usb *fc_usb)
|
|||
|
||||
if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 1)
|
||||
return -ENODEV;
|
||||
if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[1].desc))
|
||||
if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[0].desc))
|
||||
return -ENODEV;
|
||||
|
||||
switch (fc_usb->udev->speed) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue