Skip to content

Commit

Permalink
V4L/DVB (8886): ov511: fix memory leak
Browse files Browse the repository at this point in the history
Free allocated memory

Cc: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Douglas Schilling Landgraf authored and Mauro Carvalho Chehab committed Sep 29, 2008
1 parent beeb82b commit dc2b80c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/video/ov511.c
Original file line number Diff line number Diff line change
Expand Up @@ -3591,7 +3591,7 @@ static int
ov51x_init_isoc(struct usb_ov511 *ov)
{
struct urb *urb;
int fx, err, n, size;
int fx, err, n, i, size;

PDEBUG(3, "*** Initializing capture ***");

Expand Down Expand Up @@ -3662,6 +3662,8 @@ ov51x_init_isoc(struct usb_ov511 *ov)
urb = usb_alloc_urb(FRAMES_PER_DESC, GFP_KERNEL);
if (!urb) {
err("init isoc: usb_alloc_urb ret. NULL");
for (i = 0; i < n; i++)
usb_free_urb(ov->sbuf[i].urb);
return -ENOMEM;
}
ov->sbuf[n].urb = urb;
Expand Down

0 comments on commit dc2b80c

Please sign in to comment.