[media] pwc: failure to submit an urb is a fatal error
authorHans de Goede <hdegoede@redhat.com>
Tue, 16 Nov 2010 15:32:09 +0000 (12:32 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 29 Dec 2010 10:16:53 +0000 (08:16 -0200)
Failure to submit an urb is a fatal error, make isoc_init return an
error when this happens rather then only log it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/pwc/pwc-if.c

index 97319efc99482862dc0da0e4923c8cee1e3be018..bd1519a4ecb474ba62dbc3bb55ff49d922e0f727 100644 (file)
@@ -898,10 +898,13 @@ int pwc_isoc_init(struct pwc_device *pdev)
        /* link */
        for (i = 0; i < MAX_ISO_BUFS; i++) {
                ret = usb_submit_urb(pdev->sbuf[i].urb, GFP_KERNEL);
-               if (ret)
+               if (ret) {
                        PWC_ERROR("isoc_init() submit_urb %d failed with error %d\n", i, ret);
-               else
-                       PWC_DEBUG_MEMORY("URB 0x%p submitted.\n", pdev->sbuf[i].urb);
+                       pdev->iso_init = 1;
+                       pwc_isoc_cleanup(pdev);
+                       return ret;
+               }
+               PWC_DEBUG_MEMORY("URB 0x%p submitted.\n", pdev->sbuf[i].urb);
        }
 
        /* All is done... */