aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Schilling Landgraf <dougsland@linuxtv.org>2008-09-04 10:21:03 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-09-29 07:26:10 -0400
commitbeeb82becc5cdd88766b4ec21f13952e2af03324 (patch)
tree356cafa4213910b75c3477bdc8c2d5dd6d54fe43
parentff9b3e430b04e00dd2d29a26ae9438d7044a51db (diff)
V4L/DVB (8885): cpia2_usb: fix memory leak
Free allocated memory Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/cpia2/cpia2_usb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/video/cpia2/cpia2_usb.c b/drivers/media/video/cpia2/cpia2_usb.c
index a4574740350d..a8a199047cbd 100644
--- a/drivers/media/video/cpia2/cpia2_usb.c
+++ b/drivers/media/video/cpia2/cpia2_usb.c
@@ -632,7 +632,7 @@ int cpia2_usb_transfer_cmd(struct camera_data *cam,
632static int submit_urbs(struct camera_data *cam) 632static int submit_urbs(struct camera_data *cam)
633{ 633{
634 struct urb *urb; 634 struct urb *urb;
635 int fx, err, i; 635 int fx, err, i, j;
636 636
637 for(i=0; i<NUM_SBUF; ++i) { 637 for(i=0; i<NUM_SBUF; ++i) {
638 if (cam->sbuf[i].data) 638 if (cam->sbuf[i].data)
@@ -657,6 +657,9 @@ static int submit_urbs(struct camera_data *cam)
657 } 657 }
658 urb = usb_alloc_urb(FRAMES_PER_DESC, GFP_KERNEL); 658 urb = usb_alloc_urb(FRAMES_PER_DESC, GFP_KERNEL);
659 if (!urb) { 659 if (!urb) {
660 ERR("%s: usb_alloc_urb error!\n", __func__);
661 for (j = 0; j < i; j++)
662 usb_free_urb(cam->sbuf[j].urb);
660 return -ENOMEM; 663 return -ENOMEM;
661 } 664 }
662 665