From patchwork Thu Feb 20 15:43:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hariprasad Govindharajan X-Patchwork-Id: 65977 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9A983A0556; Thu, 20 Feb 2020 16:43:31 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E03A41BFA0; Thu, 20 Feb 2020 16:43:30 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id B8D491BF9F for ; Thu, 20 Feb 2020 16:43:28 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 07:43:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,464,1574150400"; d="scan'208";a="269628966" Received: from silpixa00393944.ir.intel.com ([10.237.223.184]) by fmsmga002.fm.intel.com with ESMTP; 20 Feb 2020 07:43:25 -0800 From: Hariprasad Govindharajan To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Cc: dev@dpdk.org, ferruh.yigit@intel.com, stephen@networkplumber.org, david.marchand@redhat.com, Hariprasad Govindharajan Date: Thu, 20 Feb 2020 15:43:22 +0000 Message-Id: <1582213402-18941-1-git-send-email-hariprasad.govindharajan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582205191-14105-1-git-send-email-hariprasad.govindharajan@intel.com> References: <1582205191-14105-1-git-send-email-hariprasad.govindharajan@intel.com> Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix return value in portlist parser 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" The function parse_port_list() is designed to return unsigned int value. After sanitizing the inputs, it is returning -1. Changed it to return 0. Fixes: 2df00d562d20 ("app/testpmd: add --portlist option") Cc: hariprasad.govindharajan@intel.com Signed-off-by: Hariprasad Govindharajan Acked-by: Bernard Iremonger --- app/test-pmd/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 9d95202..91db508 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2642,7 +2642,7 @@ parse_port_list(const char *list, unsigned int *values, unsigned int maxsize) unsigned int marked[maxsize]; if (list == NULL || values == NULL) - return -1; + return 0; for (i = 0; i < (int)maxsize; i++) marked[i] = 0;