Commit f5bda003 authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi

usb: gadget: printer: revert usb_add_function() effect in error recovery

Whenever the "goto fail" branch is taken, the effect of usb_add_function()
should be reverted.
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent c69b8186
...@@ -1285,6 +1285,7 @@ static int __init printer_bind_config(struct usb_configuration *c) ...@@ -1285,6 +1285,7 @@ static int __init printer_bind_config(struct usb_configuration *c)
fail: fail:
printer_cfg_unbind(c); printer_cfg_unbind(c);
usb_remove_function(c, &dev->function);
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment