diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-01-15 00:03:08 +0300 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-01-19 21:53:31 +0300 |
commit | c5b2dc68a7a7e31d8e88b3bf9d45bd9e78e9fb78 (patch) | |
tree | f6b59e57f01d63e826141cd09e16ebf9ce813114 /drivers/usb/gadget/function/uvc_configfs.c | |
parent | ceeb010ba2534f0b78efde6b3aa7d208148df92f (diff) | |
download | linux-c5b2dc68a7a7e31d8e88b3bf9d45bd9e78e9fb78.tar.xz |
usb: gadget: uvc: memory leak in uvcg_frame_make()
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>
Diffstat (limited to 'drivers/usb/gadget/function/uvc_configfs.c')
-rw-r--r-- | drivers/usb/gadget/function/uvc_configfs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c index 6d9c68163fe1..09028d21a3b6 100644 --- a/drivers/usb/gadget/function/uvc_configfs.c +++ b/drivers/usb/gadget/function/uvc_configfs.c @@ -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; |