Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -323,7 +323,10 @@ void vhost_dev_cleanup(struct vhost_dev *dev)
	dev->mm = NULL;

	WARN_ON(!list_empty(&dev->work_list));
	if (dev->worker) {
		kthread_stop(dev->worker);
		dev->worker = NULL;
	}
}

static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz)