mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 13:11:14 +00:00
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>
This commit is contained in:
parent
d9385b6352
commit
17a936117c
1 changed files with 1 additions and 0 deletions
|
@ -2765,6 +2765,7 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
|
||||||
if (rc) {
|
if (rc) {
|
||||||
INFO(common, "failed to register LUN%d: %d\n", i, rc);
|
INFO(common, "failed to register LUN%d: %d\n", i, rc);
|
||||||
common->nluns = i;
|
common->nluns = i;
|
||||||
|
put_device(&curlun->dev);
|
||||||
goto error_release;
|
goto error_release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue