linux/drivers/staging/usbip
Oleg Nesterov ba46ce30f1 staging: usbip: fix the usage of kthread_stop()
stub_shutdown_connection() and vhci_shutdown_connection() use
task_is_dead() before kthread_stop(). This buys nothing and wrong.
kthread_stop() is fine even if this thread is dead. However, if it
is dead nothing protects this task_struct, we shouldn't touch this
memory.

Change the code to do the necessary get_task_struct/put_task_struct.

This patch assumes that

	- xxx_shutdown_connection() is always called, so we can't
	  leak the task_struct.

	- kthread_stop_put() can't be called twice on the same task.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Tobias Klauser <tklauser@distanz.ch>
Cc: Matt Mooney <mfm@muteddisk.com>,
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 09:28:04 -07:00
..
userspace Merge git://git.kernel.org/pub/scm/linux/kernel/git/lwfinger/r8192E into staging-next 2011-08-23 21:17:36 -07:00
Kconfig staging: usbip: edit Kconfig and rename CONFIG options 2011-05-12 09:17:57 -07:00
Makefile staging: usbip: edit Kconfig and rename CONFIG options 2011-05-12 09:17:57 -07:00
README staging: usbip: README: we need to document the protocol 2011-06-07 14:08:51 -07:00
stub_dev.c staging: usbip: fix the usage of kthread_stop() 2012-04-10 09:28:04 -07:00
stub_main.c staging: usbip: fix to prevent potentially using uninitialized spinlock 2012-02-08 14:14:15 -08:00
stub_rx.c staging: usbip: removed #if 0'd out code 2012-02-09 09:42:23 -08:00
stub_tx.c staging: fix usbip printk format warning 2011-07-08 13:59:55 -07:00
stub.h staging: usbip: removed unused structure field 2012-02-09 09:42:22 -08:00
usbip_common.c staging: usbip: changed function return type to void 2012-02-09 09:42:23 -08:00
usbip_common.h staging: usbip: fix the usage of kthread_stop() 2012-04-10 09:28:04 -07:00
usbip_event.c staging: Add export.h for THIS_MODULE/EXPORT_SYMBOL to drivers/staging users. 2011-10-31 19:32:08 -04:00
usbip_protocol.txt staging: usbip: fix up api changes that broke windows clients 2011-09-19 10:45:03 -07:00
vhci_hcd.c staging: usbip: fix the usage of kthread_stop() 2012-04-10 09:28:04 -07:00
vhci_rx.c staging: usbip: changed function return type to void 2012-02-09 09:42:23 -08:00
vhci_sysfs.c staging: usbip: fix the usage of kthread_stop() 2012-04-10 09:28:04 -07:00
vhci_tx.c staging: usbip: replace usbip_u{dbg,err,info} and printk with dev_ and pr_ 2011-05-19 16:57:30 -07:00
vhci.h staging: usbip: Add header guards to stub.h and vhci.h 2011-08-23 14:42:34 -07:00

TODO:
	- more discussion about the protocol
	- testing
	- review of the userspace interface
	- document the protocol

Please send patches for this code to Greg Kroah-Hartman <greg@kroah.com>