summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cpia2
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-09-04 10:21:03 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-09-04 10:21:03 -0400
commit0d11d9f0bab1612d5f42f1b4f365c6405473ac73 (patch)
tree2fb33521e47c70d264165935d83de13568c4a165 /linux/drivers/media/video/cpia2
parentc53c922aa46b63d70cca443e61994fb67c692769 (diff)
downloadmediapointer-dvb-s2-0d11d9f0bab1612d5f42f1b4f365c6405473ac73.tar.gz
mediapointer-dvb-s2-0d11d9f0bab1612d5f42f1b4f365c6405473ac73.tar.bz2
cpia2_usb: fix memory leak
From: Douglas Schilling Landgraf <dougsland@linuxtv.org> Free allocated memory Priority: high Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/cpia2')
-rw-r--r--linux/drivers/media/video/cpia2/cpia2_usb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/linux/drivers/media/video/cpia2/cpia2_usb.c b/linux/drivers/media/video/cpia2/cpia2_usb.c
index 01131e984..f23d75c6f 100644
--- a/linux/drivers/media/video/cpia2/cpia2_usb.c
+++ b/linux/drivers/media/video/cpia2/cpia2_usb.c
@@ -640,7 +640,7 @@ int cpia2_usb_transfer_cmd(struct camera_data *cam,
static int submit_urbs(struct camera_data *cam)
{
struct urb *urb;
- int fx, err, i;
+ int fx, err, i, j;
for(i=0; i<NUM_SBUF; ++i) {
if (cam->sbuf[i].data)
@@ -665,6 +665,9 @@ static int submit_urbs(struct camera_data *cam)
}
urb = usb_alloc_urb(FRAMES_PER_DESC, GFP_KERNEL);
if (!urb) {
+ ERR("%s: usb_alloc_urb error!\n", __func__);
+ for (j = 0; j < i; j++)
+ usb_free_urb(cam->sbuf[j].urb);
return -ENOMEM;
}