Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit beeb82be authored by Douglas Schilling Landgraf's avatar Douglas Schilling Landgraf Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (8885): cpia2_usb: fix memory leak



Free allocated memory

Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ff9b3e43
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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)
@@ -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;
		}