]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
vdpa: fix not using CVQ buffer in case of error
authorEugenio Pérez <eperezma@redhat.com>
Fri, 2 Jun 2023 17:34:51 +0000 (19:34 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 26 Jun 2023 16:55:29 +0000 (19:55 +0300)
Bug introducing when refactoring.  Otherway, the guest never received
the used buffer.

Fixes: be4278b65fc1 ("vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: <20230602173451.1917999-1-eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
(cherry picked from commit d45243bcfc61a3c34f96a4fc34bffcb9929daba0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
net/vhost-vdpa.c

index 99904a0da75748cae02f9266b93f3fa79b9a5fdb..1c3086c892ff0a93b7cb5d0a82201a4d9f352a32 100644 (file)
@@ -765,7 +765,7 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
     }
 
     if (*s->status != VIRTIO_NET_OK) {
-        return VIRTIO_NET_ERR;
+        goto out;
     }
 
     status = VIRTIO_NET_ERR;