From: Yong Wang Date: Wed, 11 Jan 2017 08:59:46 +0000 (-0500) Subject: examples/vhost: fix lcore initialization X-Git-Tag: spdx-start~5173 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b3bee7d87d4abd01dd7a1d4163f2994f31487343;p=dpdk.git examples/vhost: fix lcore initialization when "TAILQ_INIT()" was added to the loop of "for (lcore_id = 0; ...)" statement, the assignment to "lcore_ids" was removed out of the loop. It changed the original initialization of "lcore_ids". Fix it by introducing two braces. Fixes: 45657a5c6861 ("examples/vhost: use tailq to link vhost devices") Cc: stable@dpdk.org Signed-off-by: Yong Wang Acked-by: Yuanhan Liu --- diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 81a6a8cf91..47899473b6 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1436,11 +1436,12 @@ main(int argc, char *argv[]) if (ret < 0) rte_exit(EXIT_FAILURE, "Invalid argument\n"); - for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id ++) + for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { TAILQ_INIT(&lcore_info[lcore_id].vdev_list); if (rte_lcore_is_enabled(lcore_id)) - lcore_ids[core_id ++] = lcore_id; + lcore_ids[core_id++] = lcore_id; + } if (rte_lcore_count() > RTE_MAX_LCORE) rte_exit(EXIT_FAILURE,"Not enough cores\n");