From: Patrick Fu Date: Tue, 27 Oct 2020 08:50:19 +0000 (+0800) Subject: vhost: fix uninitialized local variable X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5b4a1e7ee46617f1cdfd6d61eff5f266f70e0d93;p=dpdk.git vhost: fix uninitialized local variable This patch initializes a local parameter in async data path to avoid compiler warnings. Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring") Cc: stable@dpdk.org Signed-off-by: Patrick Fu Reviewed-by: Maxime Coquelin --- diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 0307956457..10dec5e54d 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -1491,7 +1491,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev, struct iovec *dst_iovec = vec_pool + (VHOST_MAX_ASYNC_VEC >> 1); struct rte_vhost_iov_iter *src_it = it_pool; struct rte_vhost_iov_iter *dst_it = it_pool + 1; - uint16_t n_free_slot, slot_idx; + uint16_t n_free_slot, slot_idx = 0; uint16_t pkt_err = 0; uint16_t segs_await = 0; struct async_inflight_info *pkts_info = vq->async_pkts_info;