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>
This commit is contained in:
parent
aa8a9e25c5
commit
78b620ce9e
|
@ -323,7 +323,10 @@ void vhost_dev_cleanup(struct vhost_dev *dev)
|
||||||
dev->mm = NULL;
|
dev->mm = NULL;
|
||||||
|
|
||||||
WARN_ON(!list_empty(&dev->work_list));
|
WARN_ON(!list_empty(&dev->work_list));
|
||||||
|
if (dev->worker) {
|
||||||
kthread_stop(dev->worker);
|
kthread_stop(dev->worker);
|
||||||
|
dev->worker = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz)
|
static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz)
|
||||||
|
|
Loading…
Reference in New Issue