From: Tobias Klauser Date: Fri, 24 Jun 2011 13:48:47 +0000 (+0200) Subject: Staging: usbip: vhci-hcd: Do not kill already dead RX/TX kthread X-Git-Tag: v3.1-rc1~232^2~97 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8547d4cc2b616e4f1dafebe2c673fc986422b506;p=pandora-kernel.git Staging: usbip: vhci-hcd: Do not kill already dead RX/TX kthread When unbinding a device on the host which was still attached on the client, I got a NULL pointer dereference on the client. This turned out to be due to kthread_stop() being called on an already dead kthread. Here is how I was able to reproduce the problem: server:# usbip bind -b 1-2 client:# usbip attach -h server -b 1-2 server:# usbip unbind -b 1-2 This patch fixes the problem by checking the kthread before attempting to kill it, as it is done on the opposite side in stub_shutdown_connection(). Signed-off-by: Tobias Klauser Cc: stable Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed