patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>,
	Anup Prabhu <aprabhu@marvell.com>
Cc: <dev@dpdk.org>, <sshankarnara@marvell.com>, <ptakkar@marvell.com>,
	<stable@dpdk.org>
Subject: [PATCH v2 1/1] app/mldev: fix check for filelist and models count
Date: Wed, 20 Sep 2023 00:08:51 -0700	[thread overview]
Message-ID: <20230920070851.8419-1-syalavarthi@marvell.com> (raw)
In-Reply-To: <20230830155155.29954-1-syalavarthi@marvell.com>

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 <syalavarthi@marvell.com>
---
 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


  reply	other threads:[~2023-09-20  7:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30 15:51 [PATCH v1 " Srikanth Yalavarthi
2023-09-20  7:08 ` Srikanth Yalavarthi [this message]
2023-10-04  4:05   ` [PATCH v2 " Anup Prabhu
2023-10-05  9:14   ` Shivah Shankar Shankar Narayan Rao
2023-11-14 19:41     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230920070851.8419-1-syalavarthi@marvell.com \
    --to=syalavarthi@marvell.com \
    --cc=aprabhu@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ptakkar@marvell.com \
    --cc=sshankarnara@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).