]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/media/usb/dvb-usb/dib0700_core.c
[media] dib0700: fix NULL-deref at probe
[karo-tx-linux.git] / drivers / media / usb / dvb-usb / dib0700_core.c
index dd5edd3a17ee4deddd769da0325b9a99de161670..08acdd32e412945765a0760eaca32396bed47350 100644 (file)
@@ -809,6 +809,9 @@ int dib0700_rc_setup(struct dvb_usb_device *d, struct usb_interface *intf)
 
        /* Starting in firmware 1.20, the RC info is provided on a bulk pipe */
 
+       if (intf->altsetting[0].desc.bNumEndpoints < rc_ep + 1)
+               return -ENODEV;
+
        purb = usb_alloc_urb(0, GFP_KERNEL);
        if (purb == NULL)
                return -ENOMEM;