hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/media/usb/b2c2/flexcop-usb.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III
34 * flexcop-usb.c - covers the USB part
....@@ -418,10 +419,9 @@
418419 usb_free_urb(fc_usb->iso_urb[i]);
419420 }
420421
421
- if (fc_usb->iso_buffer != NULL)
422
- usb_free_coherent(fc_usb->udev,
423
- fc_usb->buffer_size, fc_usb->iso_buffer,
424
- fc_usb->dma_addr);
422
+ usb_free_coherent(fc_usb->udev, fc_usb->buffer_size,
423
+ fc_usb->iso_buffer, fc_usb->dma_addr);
424
+
425425 }
426426
427427 static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
....@@ -512,6 +512,8 @@
512512
513513 if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 1)
514514 return -ENODEV;
515
+ if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[0].desc))
516
+ return -ENODEV;
515517
516518 switch (fc_usb->udev->speed) {
517519 case USB_SPEED_LOW:
....@@ -524,7 +526,7 @@
524526 case USB_SPEED_HIGH:
525527 info("running at HIGH speed.");
526528 break;
527
- case USB_SPEED_UNKNOWN: /* fall through */
529
+ case USB_SPEED_UNKNOWN:
528530 default:
529531 err("cannot handle USB speed because it is unknown.");
530532 return -ENODEV;