Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b42c263 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman
Browse files

media: b2c2-flexcop-usb: add sanity checking



commit 1b976fc6d684e3282914cdbe7a8d68fdce19095c upstream.

The driver needs an isochronous endpoint to be present. It will
oops in its absence. Add checking for it.

Reported-by: default avatar <syzbot+d93dff37e6a89431c158@syzkaller.appspotmail.com>
Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 56be9f1b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -537,6 +537,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;