static void mbochs_close(struct vfio_device *vdev)
{
	struct mdev_state *mdev_state =
		container_of(vdev, struct mdev_state, vdev);
	struct mbochs_dmabuf *dmabuf, *tmp;

	mutex_lock(&mdev_state->ops_lock);

	list_for_each_entry_safe(dmabuf, tmp, &mdev_state->dmabufs, next) {
		list_del(&dmabuf->next);
		if (dmabuf->buf) {
			/* free in mbochs_release_dmabuf() */
			dmabuf->unlinked = true;
		} else {
			kfree(dmabuf);
		}
	}
	mbochs_put_pages(mdev_state);

	mutex_unlock(&mdev_state->ops_lock);
}
static void mbochs_close(struct vfio_device *vdev)
{
	struct mdev_state *mdev_state =
		container_of(vdev, struct mdev_state, vdev);
	struct mbochs_dmabuf *dmabuf, *tmp;

	mutex_lock(&mdev_state->ops_lock);

	list_for_each_entry_safe(dmabuf, tmp, &mdev_state->dmabufs, next) {
		list_del(&dmabuf->next);
		if (dmabuf->buf) {
			 
			dmabuf->unlinked = true;
		} else {
			kfree(dmabuf);
		}
	}
	mbochs_put_pages(mdev_state);

	mutex_unlock(&mdev_state->ops_lock);
}