From c9b413c3b1cfb52740acb2a0fbf1b73acdb93646 Mon Sep 17 00:00:00 2001 From: Gaetan Rivet Date: Mon, 17 Dec 2018 10:25:59 +0100 Subject: [PATCH] eal: fix detection of duplicate option register Missing brackets around the if means that the loop will end at its first iteration. Fixes: 2395332798d0 ("eal: add option register infrastructure") Cc: stable@dpdk.org Signed-off-by: Gaetan Rivet Reviewed-by: Anatoly Burakov Reviewed-by: David Marchand --- lib/librte_eal/common/rte_option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/rte_option.c b/lib/librte_eal/common/rte_option.c index 7605190c3b..088e0fd236 100644 --- a/lib/librte_eal/common/rte_option.c +++ b/lib/librte_eal/common/rte_option.c @@ -35,10 +35,11 @@ void __rte_experimental rte_option_register(struct rte_option *opt) { TAILQ_FOREACH(option, &rte_option_list, next) { - if (strcmp(opt->opt_str, option->opt_str) == 0) + if (strcmp(opt->opt_str, option->opt_str) == 0) { RTE_LOG(INFO, EAL, "Option %s has already been registered.\n", opt->opt_str); return; + } } TAILQ_INSERT_HEAD(&rte_option_list, opt, next); -- 2.20.1