From: Michael S. Tsirkin Date: Tue, 19 Jul 2011 10:19:18 +0000 (+0300) Subject: vhost: fix zcopy reference counting X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=75fd9edc1054a1fa1d1411adec368dadf68e764e;p=openwrt%2Fstaging%2Fblogic.git 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 --- diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 46822c0d9f7f..c16d22545868 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1578,7 +1578,6 @@ struct vhost_ubuf_ref *vhost_ubuf_alloc(struct vhost_virtqueue *vq, if (!ubufs) return ERR_PTR(-ENOMEM); kref_init(&ubufs->kref); - kref_get(&ubufs->kref); init_waitqueue_head(&ubufs->wait); ubufs->vq = vq; return ubufs;