aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Dumazet <[email protected]>2010-08-31 02:05:57 +0000
committerDavid S. Miller <[email protected]>2010-09-01 14:26:13 -0700
commit78b620ce9e168d08ecfac2f4bb056c511b0601ec (patch)
treed7e59a37b115f52215190a7461cec96bd0247fb2
parentaa8a9e25c5e865de85410be4e9269b552974f7a2 (diff)
vhost: stop worker only if created
Its currently illegal to call kthread_stop(NULL) Reported-by: Ingo Molnar <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Tejun Heo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--drivers/vhost/vhost.c5
1 files changed, 4 insertions, 1 deletions
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)