[v2,1/1] app/mldev: fix check for filelist and models count

Message ID 20230920070851.8419-1-syalavarthi@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2,1/1] app/mldev: fix check for filelist and models count |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Srikanth Yalavarthi Sept. 20, 2023, 7:08 a.m. UTC
  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(-)
  

Comments

Anup Prabhu Oct. 4, 2023, 4:05 a.m. UTC | #1
> -----Original Message-----
> From: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Sent: Wednesday, September 20, 2023 12:39 PM
> To: Srikanth Yalavarthi <syalavarthi@marvell.com>; Anup Prabhu
> <aprabhu@marvell.com>
> Cc: dev@dpdk.org; Shivah Shankar Shankar Narayan Rao
> <sshankarnara@marvell.com>; Prince Takkar <ptakkar@marvell.com>;
> stable@dpdk.org
> Subject: [PATCH v2 1/1] app/mldev: fix check for filelist and models count
> 
> 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>
Acked-by: Anup Prabhu <aprabhu@marvell.com>
  
Shivah Shankar Shankar Narayan Rao Oct. 5, 2023, 9:14 a.m. UTC | #2
> -----Original Message-----
> From: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Sent: Wednesday, September 20, 2023 12:39 PM
> To: Srikanth Yalavarthi <syalavarthi@marvell.com>; Anup Prabhu
> <aprabhu@marvell.com>
> Cc: dev@dpdk.org; Shivah Shankar Shankar Narayan Rao
> <sshankarnara@marvell.com>; Prince Takkar <ptakkar@marvell.com>;
> stable@dpdk.org
> Subject: [PATCH v2 1/1] app/mldev: fix check for filelist and models count
> 
> 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>
Acked-by: Shivah Shankar S <sshankarnara@marvell.com>
  
Thomas Monjalon Nov. 14, 2023, 7:41 p.m. UTC | #3
05/10/2023 11:14, Shivah Shankar Shankar Narayan Rao:
> From: Srikanth Yalavarthi <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>
> Acked-by: Shivah Shankar S <sshankarnara@marvell.com>

Applied, thanks.
  

Patch

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);
 	}