summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2018-01-03 13:37:59 -0800
committerLucas De Marchi <lucas.demarchi@intel.com>2018-01-03 14:22:11 -0800
commit568b1c86cc4873c03c2df1c14cdf6dc4acfdc896 (patch)
tree1d3398963e8f1762b0fea4c4e4ccecd2efe5c10c
parentdde2770ee6d64e3f6e010edd812db5eba7a42ef4 (diff)
downloadkmod-568b1c86cc4873c03c2df1c14cdf6dc4acfdc896.tar.gz
kmod-568b1c86cc4873c03c2df1c14cdf6dc4acfdc896.tar.bz2
kmod-568b1c86cc4873c03c2df1c14cdf6dc4acfdc896.zip
testsuite: add missing error handling
If we passed an invalid argument to a test it would segfault rather than returning an error code.
-rw-r--r--testsuite/testsuite.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/testsuite/testsuite.h b/testsuite/testsuite.h
index bb0eb50..2b31483 100644
--- a/testsuite/testsuite.h
+++ b/testsuite/testsuite.h
@@ -151,6 +151,8 @@ int test_run(const struct test *t);
arg = test_init(__start_kmod_tests, __stop_kmod_tests, argc, argv); \
if (arg == 0) \
return 0; \
+ if (arg < 0) \
+ return EXIT_FAILURE; \
\
if (arg < argc) { \
t = test_find(__start_kmod_tests, __stop_kmod_tests, argv[arg]); \