summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-09-05 12:49:54 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-04 22:28:14 -0300
commit0d0548e67f0184704b7ecdf3c3ebf0e23c5af8c8 (patch)
tree7df187395e2161c41b817c7734ba43f5f3cb935b /drivers
parent1167b2e495e42d757f9bb879c60bc0cf3391eaae (diff)
downloadop-kernel-dev-0d0548e67f0184704b7ecdf3c3ebf0e23c5af8c8.zip
op-kernel-dev-0d0548e67f0184704b7ecdf3c3ebf0e23c5af8c8.tar.gz
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')
-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 ed8935d..ac95c55 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,
urb = usb_alloc_urb(npkt, GFP_KERNEL);
if (!urb) {
err("usb_alloc_urb failed");
- for (i = 0; i < n; i++)
- usb_free_urb(gspca_dev->urb[i]);
+ destroy_urbs(gspca_dev);
return -ENOMEM;
}
urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,
@@ -470,8 +469,8 @@ static int create_urbs(struct gspca_dev *gspca_dev,
if (urb->transfer_buffer == NULL) {
usb_free_urb(urb);
- destroy_urbs(gspca_dev);
err("usb_buffer_urb failed");
+ destroy_urbs(gspca_dev);
return -ENOMEM;
}
gspca_dev->urb[n] = urb;
OpenPOWER on IntegriCloud