DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal/option: fix option register duplicate detection
@ 2018-12-17  9:25 Gaetan Rivet
  2018-12-17  9:35 ` Burakov, Anatoly
  2018-12-17 10:19 ` [dpdk-dev] [PATCH] eal/option: fix option register duplicate detection David Marchand
  0 siblings, 2 replies; 8+ messages in thread
From: Gaetan Rivet @ 2018-12-17  9:25 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet, stable

Missing brackets around the if means that the loop will end at its first
iteration.

Cc: stable@dpdk.org

Fixes: 2395332798d0 ("eal: add option register infrastructure")
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 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 02d59a869..eefb8b923 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.",
 					opt->opt_str);
 			return;
+		}
 	}
 
 	TAILQ_INSERT_HEAD(&rte_option_list, opt, next);
-- 
2.19.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-12-19 22:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-17  9:25 [dpdk-dev] [PATCH] eal/option: fix option register duplicate detection Gaetan Rivet
2018-12-17  9:35 ` Burakov, Anatoly
2018-12-18 10:26   ` [dpdk-dev] [PATCH] mk: use misleading indentation warning when available Gaetan Rivet
2018-12-18 14:50     ` Ferruh Yigit
2018-12-19  9:24       ` Gaëtan Rivet
2018-12-19 10:05         ` Burakov, Anatoly
2018-12-17 10:19 ` [dpdk-dev] [PATCH] eal/option: fix option register duplicate detection David Marchand
2018-12-19 22:59   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).