aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/gspca.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index ed8935da58e0..ac95c55887df 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -459,8 +459,7 @@ static int create_urbs(struct gspca_dev *gspca_dev,
459 urb = usb_alloc_urb(npkt, GFP_KERNEL); 459 urb = usb_alloc_urb(npkt, GFP_KERNEL);
460 if (!urb) { 460 if (!urb) {
461 err("usb_alloc_urb failed"); 461 err("usb_alloc_urb failed");
462 for (i = 0; i < n; i++) 462 destroy_urbs(gspca_dev);
463 usb_free_urb(gspca_dev->urb[i]);
464 return -ENOMEM; 463 return -ENOMEM;
465 } 464 }
466 urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev, 465 urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,
@@ -470,8 +469,8 @@ static int create_urbs(struct gspca_dev *gspca_dev,
470 469
471 if (urb->transfer_buffer == NULL) { 470 if (urb->transfer_buffer == NULL) {
472 usb_free_urb(urb); 471 usb_free_urb(urb);
473 destroy_urbs(gspca_dev);
474 err("usb_buffer_urb failed"); 472 err("usb_buffer_urb failed");
473 destroy_urbs(gspca_dev);
475 return -ENOMEM; 474 return -ENOMEM;
476 } 475 }
477 gspca_dev->urb[n] = urb; 476 gspca_dev->urb[n] = urb;