usb: gadget: uvc: memory leak in uvcg_frame_make()
We need to add a kfree(h) on an error path. Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
ceeb010ba2
commit
c5b2dc68a7
|
@ -1300,6 +1300,7 @@ static struct config_item *uvcg_frame_make(struct config_group *group,
|
||||||
h->fmt_type = UVCG_MJPEG;
|
h->fmt_type = UVCG_MJPEG;
|
||||||
} else {
|
} else {
|
||||||
mutex_unlock(&opts->lock);
|
mutex_unlock(&opts->lock);
|
||||||
|
kfree(h);
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
}
|
}
|
||||||
++fmt->num_frames;
|
++fmt->num_frames;
|
||||||
|
|
Loading…
Reference in New Issue