diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-09-05 11:49:54 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-04 21:28:14 -0400 |
commit | 0d0548e67f0184704b7ecdf3c3ebf0e23c5af8c8 (patch) | |
tree | 7df187395e2161c41b817c7734ba43f5f3cb935b /drivers/media/video/gspca | |
parent | 1167b2e495e42d757f9bb879c60bc0cf3391eaae (diff) |
V4L/DVB (8926): gspca: Bad fix of leak memory (changeset 43d2ead315b1).
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 5 |
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; |