X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Fvirtio%2Fvhost_user_output.c;h=9b6c01704bf81128d6fcbc7084d1fdf1717874c7;hb=0c4699855f66e8bf89a41cf83b41adc753c30cce;hp=820594999c8570835940512c84cf73eef8081f0f;hpb=390036e0d075c632491beeb37aba4e5d07132e06;p=vpp.git diff --git a/src/vnet/devices/virtio/vhost_user_output.c b/src/vnet/devices/virtio/vhost_user_output.c index 820594999c8..9b6c01704bf 100644 --- a/src/vnet/devices/virtio/vhost_user_output.c +++ b/src/vnet/devices/virtio/vhost_user_output.c @@ -261,6 +261,12 @@ VNET_DEVICE_CLASS_TX_FN (vhost_user_device_class) (vlib_main_t * vm, VHOST_VRING_IDX_RX (*vec_elt_at_index (vui->per_cpu_tx_qid, thread_index)); rxvq = &vui->vrings[qid]; + if (PREDICT_FALSE (rxvq->avail == 0)) + { + error = VHOST_USER_TX_FUNC_ERROR_MMAP_FAIL; + goto done3; + } + if (PREDICT_FALSE (vui->use_tx_spinlock)) vhost_user_vring_lock (vui, qid);