This is a note to let you know that I've just added the patch titled

    staging: usbip: fix shutdown problems.

to my staging git tree which can be found at
    git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
in the staging-linus branch.

The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)

The patch will hopefully also will be merged in Linus's tree for the
next -rc kernel release.

If you have any questions about this process, please let me know.


>From 2f8c4c5494c2589e6cb9a62f399e61a1c4c2378d Mon Sep 17 00:00:00 2001
From: Arjan Mels <[email protected]>
Date: Tue, 5 Apr 2011 20:24:56 +0200
Subject: 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 <[email protected]>
Cc: Takahiro Hirofuchi <[email protected]>
Cc: Max Vozeler <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 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 8214c35..bce7d03 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)
        }
 
        /* 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 */
        /*
-- 
1.7.4.2


_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to