Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 533a19b4 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin
Browse files

vhost: put mm after thread stop



makes it possible to batch use/unuse mm

Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 3fcedec7
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -401,15 +401,14 @@ void vhost_dev_cleanup(struct vhost_dev *dev)
	kfree(rcu_dereference_protected(dev->memory,
	kfree(rcu_dereference_protected(dev->memory,
					lockdep_is_held(&dev->mutex)));
					lockdep_is_held(&dev->mutex)));
	RCU_INIT_POINTER(dev->memory, NULL);
	RCU_INIT_POINTER(dev->memory, NULL);
	if (dev->mm)
		mmput(dev->mm);
	dev->mm = NULL;

	WARN_ON(!list_empty(&dev->work_list));
	WARN_ON(!list_empty(&dev->work_list));
	if (dev->worker) {
	if (dev->worker) {
		kthread_stop(dev->worker);
		kthread_stop(dev->worker);
		dev->worker = NULL;
		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)
static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz)