usb: gadget: uvc: memory leak in uvcg_frame_make()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 14 Jan 2015 21:03:08 +0000 (00:03 +0300)
committerFelipe Balbi <balbi@ti.com>
Mon, 19 Jan 2015 18:53:31 +0000 (12:53 -0600)
We need to add a kfree(h) on an error path.

Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/uvc_configfs.c

index 6d9c68163fe19d41994ff074c7d06afb83da422f..09028d21a3b6e6dbecf1d7053af1b9cd391c07d5 100644 (file)
@@ -1300,6 +1300,7 @@ static struct config_item *uvcg_frame_make(struct config_group *group,
                h->fmt_type = UVCG_MJPEG;
        } else {
                mutex_unlock(&opts->lock);
+               kfree(h);
                return ERR_PTR(-EINVAL);
        }
        ++fmt->num_frames;