Skip to content

Commit

Permalink
vhost: stop worker only if created
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 1, 2010
1 parent aa8a9e2 commit 78b620c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/vhost/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 78b620c

Please sign in to comment.