aboutsummaryrefslogtreecommitdiff
path: root/drivers/vhost
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-08-31 02:05:57 +0000
committerDavid S. Miller <davem@davemloft.net>2010-09-01 14:26:13 -0700
commit78b620ce9e168d08ecfac2f4bb056c511b0601ec (patch)
treed7e59a37b115f52215190a7461cec96bd0247fb2 /drivers/vhost
parentaa8a9e25c5e865de85410be4e9269b552974f7a2 (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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index e05557d5299..4b99117f3ec 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)