hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/radio/radio-shark.c
....@@ -316,6 +316,16 @@
316316 {
317317 struct shark_device *shark;
318318 int retval = -ENOMEM;
319
+ static const u8 ep_addresses[] = {
320
+ SHARK_IN_EP | USB_DIR_IN,
321
+ SHARK_OUT_EP | USB_DIR_OUT,
322
+ 0};
323
+
324
+ /* Are the expected endpoints present? */
325
+ if (!usb_check_int_endpoints(intf, ep_addresses)) {
326
+ dev_err(&intf->dev, "Invalid radioSHARK device\n");
327
+ return -EINVAL;
328
+ }
319329
320330 shark = kzalloc(sizeof(struct shark_device), GFP_KERNEL);
321331 if (!shark)