diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-08-30 22:05:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-01 17:26:13 -0400 |
commit | 78b620ce9e168d08ecfac2f4bb056c511b0601ec (patch) | |
tree | d7e59a37b115f52215190a7461cec96bd0247fb2 /drivers/vhost | |
parent | aa8a9e25c5e865de85410be4e9269b552974f7a2 (diff) |
vhost: stop worker only if created
Its currently illegal to call kthread_stop(NULL)
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/vhost.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e05557d52999..4b99117f3ecd 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -323,7 +323,10 @@ void vhost_dev_cleanup(struct vhost_dev *dev) | |||
323 | dev->mm = NULL; | 323 | dev->mm = NULL; |
324 | 324 | ||
325 | WARN_ON(!list_empty(&dev->work_list)); | 325 | WARN_ON(!list_empty(&dev->work_list)); |
326 | kthread_stop(dev->worker); | 326 | if (dev->worker) { |
327 | kthread_stop(dev->worker); | ||
328 | dev->worker = NULL; | ||
329 | } | ||
327 | } | 330 | } |
328 | 331 | ||
329 | static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz) | 332 | static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz) |