Commit 889394b1 authored by Felipe Balbi's avatar Felipe Balbi Committed by Greg Kroah-Hartman
Browse files

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: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 619b572a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
}