From patchwork Mon Dec 17 09:25:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABtan_Rivet?= X-Patchwork-Id: 49001 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BED1A1B766; Mon, 17 Dec 2018 10:26:28 +0100 (CET) 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) 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=Uobx2zr6NlgIxOFVervSO0YSv6edJ9NhblJ127+oeTcMS5ujUtqG6Rbo+OmjTkmBk0 CgrgdOVRyJldPI14Mj6RXPq9dfzkJxpQS3htIn93I6dGuNW6wSefNhn+gwvwW0Zsbe/6 Hw5WdCqMw2ZSLBphxavZwJSZe+X7p3bIojIU/yqsMO4/DNhpRpftokfcy0Rx4H6DCUwX nSpnUTBxR8BA+FdmkAci4+rWRrjIdt0y2Lwg2V1fNrn45/zcHw72ENcONWGyWZLVl+jp FCBdt7GWYuPzv/oCFCV6GfUbUMA8/61US0am0LJbx5yB2GOPU1GTkYcvW1cqYqwy/xTN YZdg== X-Gm-Message-State: AA+aEWaNGD6FRkhOzzQ4KBK/zD2nK+Dl+rTWGuxLjRjCGgYTlQErVhpd +clHwIvXkzp1vtzxcPwaDKD6nXm/nMQ= 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 Subject: [dpdk-dev] [PATCH] eal/option: fix option register duplicate detection X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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 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 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);