aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost/vhost.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-10-06 09:34:38 -0400
committerMichael S. Tsirkin <mst@redhat.com>2010-11-04 07:22:10 -0400
commit533a19b4b88fcf81da3106b94f0ac4ac8b33a248 (patch)
treeb594af58ac551f0ac19bfb87ea2d433deaf6dcff /drivers/vhost/vhost.c
parent3fcedec752108de5d99b9f0373ff880756a1e87d (diff)
vhost: put mm after thread stop
makes it possible to batch use/unuse mm Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost/vhost.c')
-rw-r--r--drivers/vhost/vhost.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index ed277276fa98..9920bae6ee43 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -401,15 +401,14 @@ void vhost_dev_cleanup(struct vhost_dev *dev)
401 kfree(rcu_dereference_protected(dev->memory, 401 kfree(rcu_dereference_protected(dev->memory,
402 lockdep_is_held(&dev->mutex))); 402 lockdep_is_held(&dev->mutex)));
403 RCU_INIT_POINTER(dev->memory, NULL); 403 RCU_INIT_POINTER(dev->memory, NULL);
404 if (dev->mm)
405 mmput(dev->mm);
406 dev->mm = NULL;
407
408 WARN_ON(!list_empty(&dev->work_list)); 404 WARN_ON(!list_empty(&dev->work_list));
409 if (dev->worker) { 405 if (dev->worker) {
410 kthread_stop(dev->worker); 406 kthread_stop(dev->worker);
411 dev->worker = NULL; 407 dev->worker = NULL;
412 } 408 }
409 if (dev->mm)
410 mmput(dev->mm);
411 dev->mm = NULL;
413} 412}
414 413
415static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz) 414static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz)