Fix division or module by zero reported by coverity scan.
Updated .mailmap

Coverity issue: 373870
Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation")

Signed-off-by: Mohammad Iqbal Ahmad <[email protected]>
---
 .mailmap                  | 1 +
 app/test-flow-perf/main.c | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index a153c9ab93..ec9f419f53 100644
--- a/.mailmap
+++ b/.mailmap
@@ -912,6 +912,7 @@ Mitch Williams <[email protected]>
 Mit Matelske <[email protected]>
 Mohamad Noor Alim Hussin <[email protected]>
 Mohammad Abdul Awal <[email protected]>
+Mohammad Iqbal Ahmad <[email protected]>
 Mohammed Gamal <[email protected]>
 Mohsin Kazmi <[email protected]>
 Mohsin Mazhar Shaikh <[email protected]>
diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 4a9206803a..0a542b0d87 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -848,7 +848,12 @@ args_parse(int argc, char **argv)
                        /* Control */
                        if (strcmp(lgopts[opt_idx].name,
                                        "rules-batch") == 0) {
-                               rules_batch = atoi(optarg);
+                               n = atoi(optarg);
+                               if (n > 0)
+                                       rules_batch = n;
+                               else
+                                       rte_exit(EXIT_FAILURE,
+                                                       "flow rules_batch 
should be > 0\n");
                        }
                        if (strcmp(lgopts[opt_idx].name,
                                        "rules-count") == 0) {
-- 
2.25.1

Reply via email to