mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Acked-by: Michal Nazarewicz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
f88f6691b7
commit
f479d70b4f
1 changed files with 0 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue