usb: gadget: f_uvc: fix potential memory leak
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Thu, 21 Aug 2014 14:54:45 +0000 (16:54 +0200)
committerFelipe Balbi <balbi@ti.com>
Thu, 21 Aug 2014 15:03:41 +0000 (10:03 -0500)
If uvc->control_buf is successfuly allocated but uvc->control_req
is not, uvc->control_buf is not freed in the error recovery path.
With this patch applied uvc->control_buf is freed unconditionally;
if it happens to be NULL kfree on it is safe anyway.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

No differences found