Skip to content

Commit

Permalink
staging: usbip: fix shutdown problems.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arjan Mels authored and Greg Kroah-Hartman committed Apr 6, 2011
1 parent c996edc commit 2f8c4c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/staging/usbip/stub_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,10 @@ static void stub_shutdown_connection(struct usbip_device *ud)
}

/* 1. stop threads */
kthread_stop(ud->tcp_rx);
kthread_stop(ud->tcp_tx);
if (ud->tcp_rx && !task_is_dead(ud->tcp_rx))
kthread_stop(ud->tcp_rx);
if (ud->tcp_tx && !task_is_dead(ud->tcp_tx))
kthread_stop(ud->tcp_tx);

/* 2. close the socket */
/*
Expand Down

0 comments on commit 2f8c4c5

Please sign in to comment.