vhost: fix zcopy reference counting

Fix get/put refcount imbalance with zero copy,
which caused qemu to hang forever on guest driver unload.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Michael S. Tsirkin 2011-07-19 13:19:18 +03:00
parent 2723feaa8e
commit 75fd9edc10

View File

@ -1578,7 +1578,6 @@ struct vhost_ubuf_ref *vhost_ubuf_alloc(struct vhost_virtqueue *vq,
if (!ubufs) if (!ubufs)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
kref_init(&ubufs->kref); kref_init(&ubufs->kref);
kref_get(&ubufs->kref);
init_waitqueue_head(&ubufs->wait); init_waitqueue_head(&ubufs->wait);
ubufs->vq = vq; ubufs->vq = vq;
return ubufs; return ubufs;