Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265141
b: refs/heads/master
c: 91960c2
h: refs/heads/master
i:
  265139: e83db51
v: v3
  • Loading branch information
Yauheni Kaliuta authored and Greg Kroah-Hartman committed Oct 18, 2011
1 parent e2849fb commit c0701b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d749f9afa657f6ee9336b2bc1fcd750a647d157
refs/heads/master: 91960c2ef095c4b0744349e80a933921cbdcfd6e
18 changes: 9 additions & 9 deletions trunk/drivers/usb/gadget/file_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -3153,6 +3153,15 @@ static void /* __init_or_exit */ fsg_unbind(struct usb_gadget *gadget)
DBG(fsg, "unbind\n");
clear_bit(REGISTERED, &fsg->atomic_bitflags);

/* If the thread isn't already dead, tell it to exit now */
if (fsg->state != FSG_STATE_TERMINATED) {
raise_exception(fsg, FSG_STATE_EXIT);
wait_for_completion(&fsg->thread_notifier);

/* The cleanup routine waits for this completion also */
complete(&fsg->thread_notifier);
}

/* Unregister the sysfs attribute files and the LUNs */
for (i = 0; i < fsg->nluns; ++i) {
curlun = &fsg->luns[i];
Expand All @@ -3166,15 +3175,6 @@ static void /* __init_or_exit */ fsg_unbind(struct usb_gadget *gadget)
}
}

/* If the thread isn't already dead, tell it to exit now */
if (fsg->state != FSG_STATE_TERMINATED) {
raise_exception(fsg, FSG_STATE_EXIT);
wait_for_completion(&fsg->thread_notifier);

/* The cleanup routine waits for this completion also */
complete(&fsg->thread_notifier);
}

/* Free the data buffers */
for (i = 0; i < fsg_num_buffers; ++i)
kfree(fsg->buffhds[i].buf);
Expand Down

0 comments on commit c0701b6

Please sign in to comment.