summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2010-03-12 15:55:28 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-19 07:24:20 -0700
commitf479d70b4f7674083c2e3c3e603b15811713fb18 (patch)
tree8d42b82cddf3e3304f5ae955294e990af7f3aebf /drivers/usb
parentf88f6691b73a35b0c6dcabb9e587aa4c63d09010 (diff)
downloadblackbird-op-linux-f479d70b4f7674083c2e3c3e603b15811713fb18.tar.gz
blackbird-op-linux-f479d70b4f7674083c2e3c3e603b15811713fb18.zip
USB: gadget: f_mass_storage::fsg_bind(): fix error handling
Contrary to the comment in fsg_add, fsg_bind calls fsg_unbind on errors, which decreases refcount and frees the fsg_dev structure, causing trouble when fsg_add does the same. Fix it by simply leaving up cleanup to fsg_add(). Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Acked-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/f_mass_storage.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index db08de2af182..f4911c09022e 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2954,7 +2954,6 @@ static int __init fsg_bind(struct usb_configuration *c, struct usb_function *f)
autoconf_fail:
ERROR(fsg, "unable to autoconfigure all endpoints\n");
rc = -ENOTSUPP;
- fsg_unbind(c, f);
return rc;
}
OpenPOWER on IntegriCloud