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 E23EE425E4; Wed, 20 Sep 2023 09:08:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF30840DCE; Wed, 20 Sep 2023 09:08:59 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 2D6614028C; Wed, 20 Sep 2023 09:08:58 +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 38JJR6nq009223; Wed, 20 Sep 2023 00:08:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=coshrzZDAu3FDl0SkOTsQUa+FVriTvMYIKqi7+/wpmc=; b=UZP8wGyMpgPCfKqXydSTg572/CZflmgirZifnwcny649euLqdkZKiJeEjueBEQUWbZLZ /fjjMXySuRCk/VZqybuPv687gOjsguc7pjSxJnsgcyHNrjd6Hg7tEby+XBZ+ihdcJR5x 1H6KgEw3nBYnT49MKRiEthGa2HwcvrwHNySL2Y61A8UihxCT2M+njXwb5hn9FSNoh/P9 NPUp6+zlRpAqlwxnWWgAty7pcfVHHz8hxQtuel21Mj5B3jCT9RQA5kwbVDy5nqDjF0TC xNv3M64IE6yWf3b1HfL5YXi0dw8c9Qh65ownzcVA39Kv++k9QSinmq2kIJr1w/Gy8hBf EA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3t7htaswvq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 20 Sep 2023 00:08:57 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 20 Sep 2023 00:08:54 -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, 20 Sep 2023 00:08:54 -0700 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 337745B6926; Wed, 20 Sep 2023 00:08:54 -0700 (PDT) From: Srikanth Yalavarthi To: Srikanth Yalavarthi , Anup Prabhu CC: , , , Subject: [PATCH v2 1/1] app/mldev: fix check for filelist and models count Date: Wed, 20 Sep 2023 00:08:51 -0700 Message-ID: <20230920070851.8419-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230830155155.29954-1-syalavarthi@marvell.com> References: <20230830155155.29954-1-syalavarthi@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 7eS5dq-qia50fcegbYFkcLTyHKrfr9eW X-Proofpoint-GUID: 7eS5dq-qia50fcegbYFkcLTyHKrfr9eW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-20_02,2023-09-19_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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/test-mldev/ml_options.c b/app/test-mldev/ml_options.c index bed06d1bf7..d068b30df5 100644 --- a/app/test-mldev/ml_options.c +++ b/app/test-mldev/ml_options.c @@ -83,14 +83,15 @@ ml_parse_models(struct ml_options *opt, const char *arg) token = strtok(models, delim); while (token != NULL) { - strlcpy(opt->filelist[opt->nb_filelist].model, token, PATH_MAX); - opt->nb_filelist++; - if (opt->nb_filelist >= ML_TEST_MAX_MODELS) { ml_err("Exceeded model count, max = %d\n", ML_TEST_MAX_MODELS); ret = -EINVAL; break; } + + strlcpy(opt->filelist[opt->nb_filelist].model, token, PATH_MAX); + opt->nb_filelist++; + token = strtok(NULL, delim); } -- 2.41.0