Skip to content

Commit

Permalink
USB: gadget: f_mass_storage: put_device() in error recovery
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rahul Ruikar authored and Greg Kroah-Hartman committed Nov 11, 2010
1 parent d9385b6 commit 17a9361
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/gadget/f_mass_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2765,6 +2765,7 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
if (rc) {
INFO(common, "failed to register LUN%d: %d\n", i, rc);
common->nluns = i;
put_device(&curlun->dev);
goto error_release;
}

Expand Down

0 comments on commit 17a9361

Please sign in to comment.