Commit 78b620ce authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

vhost: stop worker only if created

Its currently illegal to call kthread_stop(NULL)
Reported-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aa8a9e25
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment