eal: fix detection of duplicate option register
authorGaetan Rivet <gaetan.rivet@6wind.com>
Mon, 17 Dec 2018 09:25:59 +0000 (10:25 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 19 Dec 2018 23:01:28 +0000 (00:01 +0100)
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 <gaetan.rivet@6wind.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
lib/librte_eal/common/rte_option.c

index 7605190..088e0fd 100644 (file)
@@ -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);