kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 4/6] usb: gadget: uvc: memory leak in uvcg_frame_make()
@ 2015-01-14 21:03 Dan Carpenter
  2015-01-16 11:19 ` Andrzej Pietrasiewicz
  2015-01-18 23:56 ` Laurent Pinchart
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-01-14 21:03 UTC (permalink / raw)
  To: kernel-janitors

We need to add a kfree(h) on an error path.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-18 23:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-14 21:03 [patch 4/6] usb: gadget: uvc: memory leak in uvcg_frame_make() Dan Carpenter
2015-01-16 11:19 ` Andrzej Pietrasiewicz
2015-01-18 23:56 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).