diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2015-03-03 10:52:08 +0100 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-03-10 15:33:34 -0500 |
commit | f5bda0034fba942adf5555246e248ddb66c76052 (patch) | |
tree | 4068dd9541c8b83c8cb6c37871a33c014984a241 /drivers/usb/gadget | |
parent | c69b8186945c10d245586e9f9703486e9574170c (diff) | |
download | linux-stable-f5bda0034fba942adf5555246e248ddb66c76052.tar.gz linux-stable-f5bda0034fba942adf5555246e248ddb66c76052.tar.bz2 linux-stable-f5bda0034fba942adf5555246e248ddb66c76052.zip |
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: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/legacy/printer.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c index 12247d3fe768..eb02a6b8da08 100644 --- a/drivers/usb/gadget/legacy/printer.c +++ b/drivers/usb/gadget/legacy/printer.c @@ -1285,6 +1285,7 @@ static int __init printer_bind_config(struct usb_configuration *c) fail: printer_cfg_unbind(c); + usb_remove_function(c, &dev->function); return status; } |