Skip to content

Commit

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

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 ff9b3e4 commit beeb82b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/media/video/cpia2/cpia2_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,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)
Expand All @@ -657,6 +657,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;
}

Expand Down

0 comments on commit beeb82b

Please sign in to comment.