From: Eric Dumazet Date: Tue, 31 Aug 2010 02:05:57 +0000 (+0000) Subject: vhost: stop worker only if created X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=78b620ce9e168d08ecfac2f4bb056c511b0601ec;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.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 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)