[dpdk-stable] patch 'examples/vhost: fix uninitialized descriptor indexes' has been queued to stable release 17.05.1

Yuanhan Liu yliu at fridaylinux.org
Tue Jun 20 13:35:13 CEST 2017


Hi,

FYI, your patch has been queued to stable release 17.05.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/22/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 8dccb2094bb42b56d42df0071f848b32c500321d Mon Sep 17 00:00:00 2001
From: Jerin Jacob <jerin.jacob at caviumnetworks.com>
Date: Fri, 2 Jun 2017 16:50:31 +0530
Subject: [PATCH] examples/vhost: fix uninitialized descriptor indexes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 62a0e941b5000fec02dc3bd3efed092b809ce570 ]

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")

Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 examples/vhost/virtio_net.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/examples/vhost/virtio_net.c b/examples/vhost/virtio_net.c
index cc2c3d8..5e1ed44 100644
--- a/examples/vhost/virtio_net.c
+++ b/examples/vhost/virtio_net.c
@@ -350,6 +350,9 @@ vs_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id,
 	count = RTE_MIN(count, MAX_PKT_BURST);
 	count = RTE_MIN(count, free_entries);
 
+	if (unlikely(count == 0))
+		return 0;
+
 	/*
 	 * Retrieve all of the head indexes first and pre-update used entries
 	 * to avoid caching issues.
@@ -385,8 +388,6 @@ vs_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id,
 		}
 
 	}
-	if (!i)
-		return 0;
 
 	queue->last_avail_idx += i;
 	queue->last_used_idx += i;
-- 
2.7.4



More information about the stable mailing list