From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F3A341FD0; Wed, 30 Aug 2023 17:52:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0940F40285; Wed, 30 Aug 2023 17:52:02 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 2215040279; Wed, 30 Aug 2023 17:52:01 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37U85s2g011758; Wed, 30 Aug 2023 08:51:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=p2iSQnQ+L9o66S0nrNOBIY05/0AR60KrzOp43Jsp84A=; b=ZAkY2GDyRUrN7tcKMP1zRJ7oBjlMrx19kXT7k4FenubVx0vyROmX5fgO2L+ly5tgPClj gJnpuWYdUElr1Ucjxvzjj5qFFGJ2WS4tO1fV6S+xDGmTvHP+NAhT1VuyIHWKvgFPIUGs /vOJ2/xrYU8XQCP37gFALynFwzafTSaN2sNKtmYWAHshqQsHyEk3kMiExw5SOmOfq9f4 5nsE2uUBL8GTMFFfBUNEqxeCA8Spldw5MxPFeQA6EUvN1EpGCiniOksFmZ9vlPJh/oyv YZct37cqC8K8+Z03VgihlcTxFeQ56tidq/RCylXAj4Qf3BRROMpGQwQpe5uovZxF1Fkq Dw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3st1y61fa6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 30 Aug 2023 08:51:59 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 30 Aug 2023 08:51:57 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 30 Aug 2023 08:51:57 -0700 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 03E2C3F707D; Wed, 30 Aug 2023 08:51:57 -0700 (PDT) From: Srikanth Yalavarthi To: Srikanth Yalavarthi , Anup Prabhu CC: , , , Subject: [PATCH v1 1/1] app/mldev: fix check for filelist and models count Date: Wed, 30 Aug 2023 08:51:55 -0700 Message-ID: <20230830155155.29954-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: -jM8uuZ0x2M-UGDMTbN43s18cTX--Lyj X-Proofpoint-GUID: -jM8uuZ0x2M-UGDMTbN43s18cTX--Lyj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-30_12,2023-08-29_01,2023-05-22_02 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Fix incorrect check for filelist and models count. Fixes: bbd272edcb14 ("app/mldev: add ordered inferences") Fixes: f6661e6d9a3a ("app/mldev: validate model operations") Cc: stable@dpdk.org Signed-off-by: Srikanth Yalavarthi --- app/test-mldev/ml_options.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test-mldev/ml_options.c b/app/test-mldev/ml_options.c index bed06d1bf7d..816e41fdb70 100644 --- a/app/test-mldev/ml_options.c +++ b/app/test-mldev/ml_options.c @@ -86,7 +86,7 @@ ml_parse_models(struct ml_options *opt, const char *arg) strlcpy(opt->filelist[opt->nb_filelist].model, token, PATH_MAX); opt->nb_filelist++; - if (opt->nb_filelist >= ML_TEST_MAX_MODELS) { + if (opt->nb_filelist > ML_TEST_MAX_MODELS) { ml_err("Exceeded model count, max = %d\n", ML_TEST_MAX_MODELS); ret = -EINVAL; break; @@ -109,7 +109,7 @@ ml_parse_filelist(struct ml_options *opt, const char *arg) char filelist[PATH_MAX]; char *token; - if (opt->nb_filelist >= ML_TEST_MAX_MODELS) { + if (opt->nb_filelist > ML_TEST_MAX_MODELS) { ml_err("Exceeded filelist count, max = %d\n", ML_TEST_MAX_MODELS); return -1; } -- 2.41.0