diff options
author | Oleg Nesterov <oleg@redhat.com> | 2012-03-13 18:07:18 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-10 16:28:04 (GMT) |
commit | ba46ce30f13a13bb24d05e21df2571ad724f1a1e (patch) | |
tree | 1bf3d9685389f6effee3db17307409abe9093e2d /drivers/staging/nvec | |
parent | 96ddcd439871658b797289dde8fcead8bde73b68 (diff) | |
download | linux-ba46ce30f13a13bb24d05e21df2571ad724f1a1e.tar.xz |
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>
Diffstat (limited to 'drivers/staging/nvec')
0 files changed, 0 insertions, 0 deletions