projects
/
platform
/
upstream
/
kmod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dde2770
)
testsuite: add missing error handling
author
Lucas De Marchi
<lucas.demarchi@intel.com>
Wed, 3 Jan 2018 21:37:59 +0000
(13:37 -0800)
committer
Lucas De Marchi
<lucas.demarchi@intel.com>
Wed, 3 Jan 2018 22:22:11 +0000
(14:22 -0800)
If we passed an invalid argument to a test it would segfault rather than
returning an error code.
testsuite/testsuite.h
patch
|
blob
|
history
diff --git
a/testsuite/testsuite.h
b/testsuite/testsuite.h
index
bb0eb50
..
2b31483
100644
(file)
--- 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]); \