diff options
author | Felipe Balbi <felipe.balbi@nokia.com> | 2008-12-08 06:50:27 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-07 13:00:03 -0500 |
commit | 889394b1eb95f040525d06dd4f2f1222b94023e2 (patch) | |
tree | 40aea59fc30c426eb0f3e20fc3f3f2208c438876 | |
parent | 619b572ae205cea26b147c2cec5ebf19974f4bb0 (diff) |
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>
-rw-r--r-- | drivers/usb/gadget/file_storage.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index 93933155e81c..b10fa31cc915 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c | |||
@@ -4182,6 +4182,7 @@ out: | |||
4182 | fsg->state = FSG_STATE_TERMINATED; // The thread is dead | 4182 | fsg->state = FSG_STATE_TERMINATED; // The thread is dead |
4183 | fsg_unbind(gadget); | 4183 | fsg_unbind(gadget); |
4184 | close_all_backing_files(fsg); | 4184 | close_all_backing_files(fsg); |
4185 | complete(&fsg->thread_notifier); | ||
4185 | return rc; | 4186 | return rc; |
4186 | } | 4187 | } |
4187 | 4188 | ||