Skip to content

Commit e1f13c8

Browse files
thazhemadamgregkh
authored andcommitted
staging: comedi: check validity of wMaxPacketSize of usb endpoints found
While finding usb endpoints in vmk80xx_find_usb_endpoints(), check if wMaxPacketSize = 0 for the endpoints found. Some devices have isochronous endpoints that have wMaxPacketSize = 0 (as required by the USB-2 spec). However, since this doesn't apply here, wMaxPacketSize = 0 can be considered to be invalid. Reported-by: [email protected] Tested-by: [email protected] Signed-off-by: Anant Thazhemadam <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 868fd97 commit e1f13c8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/staging/comedi/drivers/vmk80xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,9 @@ static int vmk80xx_find_usb_endpoints(struct comedi_device *dev)
667667
if (!devpriv->ep_rx || !devpriv->ep_tx)
668668
return -ENODEV;
669669

670+
if (!usb_endpoint_maxp(devpriv->ep_rx) || !usb_endpoint_maxp(devpriv->ep_tx))
671+
return -EINVAL;
672+
670673
return 0;
671674
}
672675

0 commit comments

Comments
 (0)