diff options
author | Zqiang <qiang.zhang@windriver.com> | 2020-09-27 16:01:16 +0800 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2020-10-02 09:57:45 +0300 |
commit | f0c485663d5976acb1cb490981a4763a215df75e (patch) | |
tree | 335d2090384398136f999a5a930ff349a51ee756 /drivers/usb/gadget | |
parent | 7f2958d9ad58a41df81a7c1e28dd5ddeeec58890 (diff) | |
download | linux-f0c485663d5976acb1cb490981a4763a215df75e.tar.bz2 |
usb: gadget: uvc: Fix the wrong v4l2_device_unregister call
If an error occurred before calling the 'v4l2_device_register' func,
and then goto error, but no need to call 'v4l2_device_unregister'
func.
Signed-off-by: Zqiang <qiang.zhang@windriver.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/function/f_uvc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c index 0b9712616455..44b4352a2676 100644 --- a/drivers/usb/gadget/function/f_uvc.c +++ b/drivers/usb/gadget/function/f_uvc.c @@ -740,20 +740,20 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f) /* Initialise video. */ ret = uvcg_video_init(&uvc->video, uvc); if (ret < 0) - goto error; + goto v4l2_error; /* Register a V4L2 device. */ ret = uvc_register_video(uvc); if (ret < 0) { uvcg_err(f, "failed to register video device\n"); - goto error; + goto v4l2_error; } return 0; -error: +v4l2_error: v4l2_device_unregister(&uvc->v4l2_dev); - +error: if (uvc->control_req) usb_ep_free_request(cdev->gadget->ep0, uvc->control_req); kfree(uvc->control_buf); |