diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-08-31 02:05:57 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-01 14:26:13 -0700 |
commit | 78b620ce9e168d08ecfac2f4bb056c511b0601ec (patch) | |
tree | d7e59a37b115f52215190a7461cec96bd0247fb2 /drivers/vhost | |
parent | aa8a9e25c5e865de85410be4e9269b552974f7a2 (diff) | |
download | talos-obmc-linux-78b620ce9e168d08ecfac2f4bb056c511b0601ec.tar.gz talos-obmc-linux-78b620ce9e168d08ecfac2f4bb056c511b0601ec.zip |
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) dev->mm = NULL; WARN_ON(!list_empty(&dev->work_list)); - kthread_stop(dev->worker); + if (dev->worker) { + kthread_stop(dev->worker); + dev->worker = NULL; + } } static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz) |