summaryrefslogtreecommitdiffstats
path: root/drivers/vhost
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-10-06 15:34:38 +0200
committerMichael S. Tsirkin <mst@redhat.com>2010-11-04 13:22:10 +0200
commit533a19b4b88fcf81da3106b94f0ac4ac8b33a248 (patch)
treeb594af58ac551f0ac19bfb87ea2d433deaf6dcff /drivers/vhost
parent3fcedec752108de5d99b9f0373ff880756a1e87d (diff)
downloadop-kernel-dev-533a19b4b88fcf81da3106b94f0ac4ac8b33a248.zip
op-kernel-dev-533a19b4b88fcf81da3106b94f0ac4ac8b33a248.tar.gz
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')
-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 ed27727..9920bae 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -401,15 +401,14 @@ void vhost_dev_cleanup(struct vhost_dev *dev)
kfree(rcu_dereference_protected(dev->memory,
lockdep_is_held(&dev->mutex)));
RCU_INIT_POINTER(dev->memory, NULL);
- if (dev->mm)
- mmput(dev->mm);
- dev->mm = NULL;
-
WARN_ON(!list_empty(&dev->work_list));
if (dev->worker) {
kthread_stop(dev->worker);
dev->worker = NULL;
}
+ if (dev->mm)
+ mmput(dev->mm);
+ dev->mm = NULL;
}
static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz)
OpenPOWER on IntegriCloud