V4L/DVB (9603): dvb-ttusb-budget: Add validation for ttusb_alloc_iso_urbs
authorDouglas Schilling Landgraf <dougsland@linuxtv.org>
Wed, 12 Nov 2008 02:37:39 +0000 (23:37 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 17 Nov 2008 01:54:40 +0000 (23:54 -0200)
Added validation for ttusb_alloc_iso_urbs

Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c

index 5faeee3f70bf9e37fda33e4f2588aa12758981c5..4a3f2b8ea37d448a6cb0f062cc089e2d63114ff7 100644 (file)
@@ -1665,7 +1665,14 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
 
        ttusb_setup_interfaces(ttusb);
 
-       ttusb_alloc_iso_urbs(ttusb);
+       result = ttusb_alloc_iso_urbs(ttusb);
+       if (result < 0) {
+               dprintk("%s: ttusb_alloc_iso_urbs - failed\n", __func__);
+               mutex_unlock(&ttusb->semi2c);
+               kfree(ttusb);
+               return result;
+       }
+
        if (ttusb_init_controller(ttusb))
                printk("ttusb_init_controller: error\n");