提交 889394b1 编写于 作者: F Felipe Balbi 提交者: Greg Kroah-Hartman

USB: gadget: don't wait for completion twice

In some obscure scenarios e.g. passing a 0-byte backing file
storage, wait_for_completion() would wait forever in fsg_cleanup().

Prevent it by completing the thread in fsg_bind() error path.
Signed-off-by: NFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 619b572a
......@@ -4182,6 +4182,7 @@ static int __init fsg_bind(struct usb_gadget *gadget)
fsg->state = FSG_STATE_TERMINATED; // The thread is dead
fsg_unbind(gadget);
close_all_backing_files(fsg);
complete(&fsg->thread_notifier);
return rc;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册