Skip to content

Commit

Permalink
media: flexcop-usb: sanity checking of endpoint type
Browse files Browse the repository at this point in the history
Make sure the endpoint is ISOC in and do not hard code USB_DIR_IN.

Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: Sean Young <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
oneukum authored and mchehab committed Sep 27, 2020
1 parent e8897ac commit d725d20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions drivers/media/usb/b2c2/flexcop-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ 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))
return -ENODEV;

switch (fc_usb->udev->speed) {
case USB_SPEED_LOW:
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/usb/b2c2/flexcop-usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#define B2C2_USB_CTRL_PIPE_IN usb_rcvctrlpipe(fc_usb->udev, 0)
#define B2C2_USB_CTRL_PIPE_OUT usb_sndctrlpipe(fc_usb->udev, 0)
#define B2C2_USB_DATA_PIPE usb_rcvisocpipe(fc_usb->udev, 0x81)
#define B2C2_USB_DATA_PIPE usb_rcvisocpipe(fc_usb->udev, 1)

struct flexcop_usb {
struct usb_device *udev;
Expand Down

0 comments on commit d725d20

Please sign in to comment.