Additional check for impossible negative number of threads
Signed-off-by: Mike Holmes <[email protected]>
---
test/api_test/odp_atomic_test.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/api_test/odp_atomic_test.c b/test/api_test/odp_atomic_test.c
index 9019d4f..d92a8c1 100644
--- a/test/api_test/odp_atomic_test.c
+++ b/test/api_test/odp_atomic_test.c
@@ -318,12 +318,13 @@ int main(int argc, char *argv[])
goto err_exit;
}
if (test_type < TEST_MIX || test_type > TEST_MAX ||
- pthrdnum > odp_sys_core_count()) {
+ pthrdnum > odp_sys_core_count() || pthrdnum < 0) {
usage();
goto err_exit;
}
cnt -= 2;
}
+
if (pthrdnum == 0)
pthrdnum = odp_sys_core_count();
--
2.1.0
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp