Re: [patch 4/6] usb: gadget: uvc: memory leak in uvcg_frame_make()
Hi Dan, Thank you for the patch. 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 Acked-by: Laurent Pinchart > diff --git a/drivers/usb/gadget/function/uvc_configfs.c > b/drivers/usb/gadget/function/uvc_configfs.c index 738d68f..1af2686 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; -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 4/6] usb: gadget: uvc: memory leak in uvcg_frame_make()
W dniu 14.01.2015 o 22:03, Dan Carpenter pisze: We need to add a kfree(h) on an error path. Signed-off-by: Dan Carpenter Acked-by: Andrzej Pietrasiewicz diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c index 738d68f..1af2686 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; -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[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 diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c index 738d68f..1af2686 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; -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html