From: Eric Dumazet Date: Tue, 31 Aug 2010 02:05:57 +0000 (+0000) Subject: vhost: stop worker only if created X-Git-Tag: v5.15~28096^2~12 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=78b620ce9e168d08ecfac2f4bb056c511b0601ec;p=mirror_ubuntu-kernels.git vhost: stop worker only if created Its currently illegal to call kthread_stop(NULL) Reported-by: Ingo Molnar Signed-off-by: Eric Dumazet Acked-by: Tejun Heo Signed-off-by: David S. Miller --- 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)