[PATCH v1 1/1] app/mldev: fix check for filelist and models count

Srikanth Yalavarthi syalavarthi at marvell.com
Wed Aug 30 17:51:55 CEST 2023


Fix incorrect check for filelist and models count.

Fixes: bbd272edcb14 ("app/mldev: add ordered inferences")
Fixes: f6661e6d9a3a ("app/mldev: validate model operations")
Cc: stable at dpdk.org

Signed-off-by: Srikanth Yalavarthi <syalavarthi at marvell.com>
---
 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



More information about the stable mailing list