]> 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 S. Tsirkin <mst@redhat.com>
Mon, 26 Jun 2023 13:50:00 +0000 (09:50 -0400)
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>
net/vhost-vdpa.c

index 75352efa390ef7393507a0de4268308213215c19..9e92b3558c75a2d6900264e02c1080698f08a5ca 100644 (file)
@@ -794,7 +794,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;