diff options
author | Arjan Mels <arjan.mels@gmx.net> | 2011-04-05 14:24:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-06 18:51:13 -0400 |
commit | 2f8c4c5494c2589e6cb9a62f399e61a1c4c2378d (patch) | |
tree | 5fc684d749f0ae5bd03221c5f4cc183979a81d60 | |
parent | c996edcf1c451b81740abbcca5257ed7e353fcc6 (diff) |
staging: usbip: fix shutdown problems.
When shuting down the tcp_rx and tcp_tx threads first check if they are
not closed already (maybe because an error caused them to return).
Signed-off-by: Arjan Mels <arjan.mels@gmx.net>
Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net>
Cc: Max Vozeler <max@vozeler.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/usbip/stub_dev.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c index 8214c353d9f5..bce7d039346c 100644 --- a/drivers/staging/usbip/stub_dev.c +++ b/drivers/staging/usbip/stub_dev.c | |||
@@ -220,8 +220,10 @@ static void stub_shutdown_connection(struct usbip_device *ud) | |||
220 | } | 220 | } |
221 | 221 | ||
222 | /* 1. stop threads */ | 222 | /* 1. stop threads */ |
223 | kthread_stop(ud->tcp_rx); | 223 | if (ud->tcp_rx && !task_is_dead(ud->tcp_rx)) |
224 | kthread_stop(ud->tcp_tx); | 224 | kthread_stop(ud->tcp_rx); |
225 | if (ud->tcp_tx && !task_is_dead(ud->tcp_tx)) | ||
226 | kthread_stop(ud->tcp_tx); | ||
225 | 227 | ||
226 | /* 2. close the socket */ | 228 | /* 2. close the socket */ |
227 | /* | 229 | /* |