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:
Felipe Balbi 2008-12-08 13:50:27 +02:00 committed by Greg Kroah-Hartman
parent 619b572ae2
commit 889394b1eb
1 changed files with 1 additions and 0 deletions

View File

@ -4182,6 +4182,7 @@ out:
fsg->state = FSG_STATE_TERMINATED; // The thread is dead
fsg_unbind(gadget);
close_all_backing_files(fsg);
complete(&fsg->thread_notifier);
return rc;
}