'parse_xstats_ids()' return 'int'. The return value is assigned to
'nb_xstats_ids' unsigned value, later negative check on this variable is
wrong.
Adding interim 'int' variable for negative check.
Fixes:
7ac16a3660c0 ("app/proc-info: support xstats by ID and by name")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
} else if (!strncmp(long_option[option_index].name,
"xstats-ids",
MAX_LONG_OPT_SZ)) {
- nb_xstats_ids = parse_xstats_ids(optarg,
+ int ret = parse_xstats_ids(optarg,
xstats_ids, MAX_NB_XSTATS_IDS);
-
- if (nb_xstats_ids <= 0) {
+ if (ret <= 0) {
printf("xstats-id list parse error.\n");
return -1;
}
-
+ nb_xstats_ids = ret;
}
break;
default: