提交 c5b2dc68 编写于 作者: D Dan Carpenter 提交者: Felipe Balbi

usb: gadget: uvc: memory leak in uvcg_frame_make()

We need to add a kfree(h) on an error path.
Acked-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 ceeb010b
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册