aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_mass_storage.c
diff options
context:
space:
mode:
authorRahul Ruikar <rahul.ruikar@gmail.com>2010-10-28 11:31:19 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-11-11 08:58:48 -0500
commit17a936117c587c23aafafdb9cd6d433a90daa83d (patch)
tree914f9ba0ef9df9bef4522a6b897967e09fe1d078 /drivers/usb/gadget/f_mass_storage.c
parentd9385b6352da7fed50981f375c2ccb60354039a6 (diff)
USB: gadget: f_mass_storage: put_device() in error recovery
This commit fixes an issue with error recovery after device_register() fails in Mass Storage Function. The device needs to be put to avoid resource leakage. Signed-off-by: Rahul Ruikar <rahul.ruikar@gmail.com> [mina86@mina86.com: updated commit message] Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/f_mass_storage.c')
-rw-r--r--drivers/usb/gadget/f_mass_storage.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 838286b1cd14..c89b99295c1f 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2765,6 +2765,7 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
2765 if (rc) { 2765 if (rc) {
2766 INFO(common, "failed to register LUN%d: %d\n", i, rc); 2766 INFO(common, "failed to register LUN%d: %d\n", i, rc);
2767 common->nluns = i; 2767 common->nluns = i;
2768 put_device(&curlun->dev);
2768 goto error_release; 2769 goto error_release;
2769 } 2770 }
2770 2771