summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/ov511.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-09-04 10:21:58 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-09-04 10:21:58 -0400
commit3227f6d5c7386e8f58488ae8023fa844974bd9ec (patch)
treeff0fa7612dbc6aaf347088151fcdadde34eb4187 /linux/drivers/media/video/ov511.c
parent0d11d9f0bab1612d5f42f1b4f365c6405473ac73 (diff)
downloadmediapointer-dvb-s2-3227f6d5c7386e8f58488ae8023fa844974bd9ec.tar.gz
mediapointer-dvb-s2-3227f6d5c7386e8f58488ae8023fa844974bd9ec.tar.bz2
ov511: fix memory leak
From: Douglas Schilling Landgraf <dougsland@linuxtv.org> Free allocated memory Priority: high Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org> CC: Luca Risolia <luca.risolia@studio.unibo.it> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/ov511.c')
-rw-r--r--linux/drivers/media/video/ov511.c4
1 files changed, 3 insertions, 1 deletions
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;