mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
commit 8547d4cc2b upstream.
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 <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
TODO: - more discussion about the protocol - testing - review of the userspace interface Please send patches for this code to Greg Kroah-Hartman <greg@kroah.com>