From 3227f6d5c7386e8f58488ae8023fa844974bd9ec Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 4 Sep 2008 10:21:58 -0400 Subject: ov511: fix memory leak From: Douglas Schilling Landgraf Free allocated memory Priority: high Signed-off-by: Douglas Schilling Landgraf CC: Luca Risolia Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/ov511.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'linux') diff --git a/linux/drivers/media/video/ov511.c b/linux/drivers/media/video/ov511.c index 1c5b07566..5912fff9c 100644 --- a/linux/drivers/media/video/ov511.c +++ b/linux/drivers/media/video/ov511.c @@ -3595,7 +3595,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 ***"); @@ -3666,6 +3666,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; -- cgit v1.2.3