kernel/drivers/media/radio/radio-shark2.c
.. .. @@ -282,6 +282,16 @@ 282 282 { 283 283 struct shark_device *shark; 284 284 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 + }285 295 286 296 shark = kzalloc(sizeof(struct shark_device), GFP_KERNEL); 287 297 if (!shark)