提交 17a93611 编写于 作者: R Rahul Ruikar 提交者: Greg Kroah-Hartman

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: NRahul Ruikar <rahul.ruikar@gmail.com>
[mina86@mina86.com: updated commit message]
Signed-off-by: NMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 d9385b63
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册