The index in rte_vhost_set_last_inflight_io_split is from
the frontend driver, check if it's in the virtqueue range.
Fixes:
bb0c2de9602b ("vhost: add APIs to operate inflight ring")
Cc: stable@dpdk.org
Signed-off-by: Li Feng <fengli@smartx.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
if (unlikely(!vq->inflight_split))
return -1;
+ if (unlikely(idx >= vq->size))
+ return -1;
+
vq->inflight_split->last_inflight_io = idx;
return 0;
}