diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-02-13 09:53:34 +0300 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-02-13 09:53:34 +0300 |
commit | c170093d31bd4e3bc51881cc0f123beeca7872c9 (patch) | |
tree | d93cd280d525dd339f33be010c75b7fd0bacd690 /drivers/media/video/tlg2300/pd-video.c | |
parent | 557218e2d662574bc58d840fe116c7fd8d57aed8 (diff) | |
parent | 78bba987bc025a7263248501b453476e77b93331 (diff) | |
download | linux-c170093d31bd4e3bc51881cc0f123beeca7872c9.tar.xz |
Merge branch 'devicetree/merge' into spi/merge
Diffstat (limited to 'drivers/media/video/tlg2300/pd-video.c')
-rw-r--r-- | drivers/media/video/tlg2300/pd-video.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/video/tlg2300/pd-video.c b/drivers/media/video/tlg2300/pd-video.c index a1ffe18640fe..df33a1d188bb 100644 --- a/drivers/media/video/tlg2300/pd-video.c +++ b/drivers/media/video/tlg2300/pd-video.c @@ -512,19 +512,20 @@ int alloc_bulk_urbs_generic(struct urb **urb_array, int num, int buf_size, gfp_t gfp_flags, usb_complete_t complete_fn, void *context) { - struct urb *urb; - void *mem; - int i; + int i = 0; - for (i = 0; i < num; i++) { - urb = usb_alloc_urb(0, gfp_flags); + for (; i < num; i++) { + void *mem; + struct urb *urb = usb_alloc_urb(0, gfp_flags); if (urb == NULL) return i; mem = usb_alloc_coherent(udev, buf_size, gfp_flags, &urb->transfer_dma); - if (mem == NULL) + if (mem == NULL) { + usb_free_urb(urb); return i; + } usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, ep_addr), mem, buf_size, complete_fn, context); |