From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gaetan Rivet Subject: [PATCH] eal/option: fix option register duplicate detection Date: Mon, 17 Dec 2018 10:25:59 +0100 Message-ID: <20181217092559.21801-1-gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Gaetan Rivet , stable@dpdk.org To: dev@dpdk.org Return-path: Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id AC97D374 for ; Mon, 17 Dec 2018 10:26:27 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id s12so11033515wrt.4 for ; Mon, 17 Dec 2018 01:26:27 -0800 (PST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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