summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorDouglas Schilling Landgraf <dougsland@linuxtv.org>2008-09-04 11:23:06 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-09-29 08:26:24 -0300
commitadf8c021d527b9c0247070513a8fa8cfd50668ed (patch)
treeccadb64748811cf2418f1d63b32de9a05c5bc67a /drivers/media
parentdc2b80c191a67de8191f6323d532132fb257e402 (diff)
V4L/DVB (8887): gspca: fix memory leak
Free allocated memory Cc: Jean-Francois Moine <moinejf@free.fr> Cc: Hans de Goede <j.w.r.degoede@hhs.nl> Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/gspca/gspca.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 7be69284da0..ed8935da58e 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -459,6 +459,8 @@ 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]);
return -ENOMEM;
}
urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,