usb: gadget: uvc: memory leak in uvcg_frame_make()
Subsystems (3)
PATCH 4/6 usb: gadget: uvc: memory leak in uvcg_frame_make()
We need to add a kfree(h) on an error path.
Signed-off-by Dan Carpenter <[email protected]>
drivers/usb/gadget/function/uvc_configfs.c +1 -0
@@ -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;
W dniu 14.01.2015 o 22:03, Dan Carpenter pisze:
Quoted 4 lines
We need to add a kfree(h) on an error path.
Signed-off-by Dan Carpenter <[email protected]>
Quoted 17 lines
drivers/usb/gadget/function/uvc_configfs.c +1
-1@@ -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; --To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Dan,
Thank you for the patch.
Quoted 3 lines · On Thursday 15 January 2015 00:03:08 Dan Carpenter wrote:
We need to add a kfree(h) on an error path.
Signed-off-by Dan Carpenter <[email protected]>
Acked-by Laurent Pinchart <[email protected]>
Quoted 12 lines
(quoted diff) +0
-0
b/drivers/usb/gadget/function/uvc_configfs.cindex 738d68f..1af2686 100644drivers/usb/gadget/function/uvc_configfs.c +1
-0@@ -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;
Signature · 3 lines
Regards, Laurent Pinchart