From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 63558374 for ; Mon, 17 Dec 2018 10:26:27 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id s12so11033499wrt.4 for ; Mon, 17 Dec 2018 01:26:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=l5+lvKIi4qYDy3EbgYKX/QLUIfgsSCYht+ym8Iw/vJY=; b=ufO1J0fzDi+0QlRayNJ+RSM+42y7fQthnpMxBetqAIiR8xKxsW1ffD3nRDXSbtoHwS yG58XUPQg0hCRgovzaDplrGEjTkxZQxmSTOo90kahWaNAqfNAdVAvGUgIT4c7JtB6zzK e84AGSn+4ycqjW7x/CfIH6I1jlz2fmwgkkeI4kx9S2VIZ5oRvUTKhhuu+ik7rIoEgm3n hhoby5HM2Pyaa+kJeJcUfG3AMMKmTN+Wt+6HR/nL/rvfM2DjdXGD5OpgMES12O5qc5cQ w07JSKgGlL6BVTA+t2G7vijBvt4JcgQ0sVsmH8UCiwtfaEhUpUzIv+it00z8G94qLy/z 5pEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=l5+lvKIi4qYDy3EbgYKX/QLUIfgsSCYht+ym8Iw/vJY=; b=CYEHKB8fMNnQOJ8CisOCpq6y1tl0C6NzuAY/G0tvywfNl8Juc1oIY2uPramIcPcJ6C JAZHtK/f9Cy1TssTWwR97dCSTMis2umZpT2ihrFmSo2HxjvHHjN/jzDL3GZQ3B2QY11H Cn3ea7SIDvLwggn0CoxTdhj2scynthCyWpwytuwDEyHBGeFC3bpBLzF2spdyn6v0PzlR OMDRD4HqtgMesWTA9s7zr/8+bhLZZAOhN9yJeeZYMesrHlty63JvBqQqy7N8ECcWswgO 4tOFVn7xxAccGyGUReS6Hd7zSEMgmLf9o3oas1XDuY79Ea43Lt1eKVw8Tx61XIVxa5rd xb+w== X-Gm-Message-State: AA+aEWZVf+fO9PWQu9apfhH8JWg8A5ZYrCAD/cFRPRbO8NxyWXT+6ruP Wi4zuo4S7JVpygjbEQTell/15Q== X-Google-Smtp-Source: AFSGD/Xvb1s43PX+2lZd3PyPmm3v4rVxKlgXu/Y0hG+0QYfYYR9VHfaL8kbzcwg4pVTn8J3spilzGA== X-Received: by 2002:a05:6000:8a:: with SMTP id m10mr9528941wrx.79.1545038786909; Mon, 17 Dec 2018 01:26:26 -0800 (PST) Received: from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 202sm19924135wmt.8.2018.12.17.01.26.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Dec 2018 01:26:26 -0800 (PST) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet , stable@dpdk.org Date: Mon, 17 Dec 2018 10:25:59 +0100 Message-Id: <20181217092559.21801-1-gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] eal/option: fix option register duplicate detection X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2018 09:26:27 -0000 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