mirror of
https://github.com/torvalds/linux.git
synced 2026-07-16 02:25:47 +02:00
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: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
619b572ae2
commit
889394b1eb
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user