aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost/vhost.c
diff options
context:
space:
mode:
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)