examples/vhost: fix uninitialized descriptor indexes
authorJerin Jacob <jerin.jacob@caviumnetworks.com>
Fri, 2 Jun 2017 11:20:31 +0000 (16:50 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 5 Jun 2017 12:28:32 +0000 (14:28 +0200)
commit62a0e941b5000fec02dc3bd3efed092b809ce570
tree0336f40643d474f99956b5e4674ec527ab41e9fa
parent35f30466d65ebe8926720b30c9ed82c7142a9cae
examples/vhost: fix uninitialized descriptor indexes

Fixing the below error by returning from the function early
when count == 0.

Issue flagged by GCC 7.1.1

examples/vhost/virtio_net.c:370:38: error: ‘desc_indexes[0]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
  rte_prefetch0(&vr->desc[desc_indexes[0]]);

Fixes: ca059fa5e290 ("examples/vhost: demonstrate the new generic APIs")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
examples/vhost/virtio_net.c