hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/radio/radio-shark2.c
....@@ -282,6 +282,16 @@
282282 {
283283 struct shark_device *shark;
284284 int retval = -ENOMEM;
285
+ static const u8 ep_addresses[] = {
286
+ SHARK_IN_EP | USB_DIR_IN,
287
+ SHARK_OUT_EP | USB_DIR_OUT,
288
+ 0};
289
+
290
+ /* Are the expected endpoints present? */
291
+ if (!usb_check_int_endpoints(intf, ep_addresses)) {
292
+ dev_err(&intf->dev, "Invalid radioSHARK2 device\n");
293
+ return -EINVAL;
294
+ }
285295
286296 shark = kzalloc(sizeof(struct shark_device), GFP_KERNEL);
287297 if (!shark)