Skip to content

Commit

Permalink
media: b2c2-flexcop-usb: add sanity checking
Browse files Browse the repository at this point in the history
The driver needs an isochronous endpoint to be present. It will
oops in its absence. Add checking for it.

Reported-by: syzbot+d93dff37e6a89431c158@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
  • Loading branch information
Oliver Neukum authored and Mauro Carvalho Chehab committed Nov 9, 2019
1 parent d527417 commit 1b976fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/media/usb/b2c2/flexcop-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,9 @@ static int flexcop_usb_probe(struct usb_interface *intf,
struct flexcop_device *fc = NULL;
int ret;

if (intf->cur_altsetting->desc.bNumEndpoints < 1)
return -ENODEV;

if ((fc = flexcop_device_kmalloc(sizeof(struct flexcop_usb))) == NULL) {
err("out of memory\n");
return -ENOMEM;
Expand Down

0 comments on commit 1b976fc

Please sign in to comment.