The state handle in kunit_module_notify() is not correct when the mod->state switch from MODULE_STATE_COMING to MODULE_STATE_GOING.
And it's necessary to check NULL for kzalloc() in kunit_parse_glob_filter().
The order in which memory is released in err path in kunit_filter_suites() is also problematic.
And there is a possible memory leak in kunit_filter_suites().
This patchset fix the above issues.
Jinjie Ruan (4): kunit: Fix wild-memory-access bug in kunit_free_suite_set() kunit: Fix possible null-ptr-deref in kunit_parse_glob_filter() kunit: Fix possible memory leak in kunit_filter_suites() kunit: Fix the wrong error path in kunit_filter_suites()
lib/kunit/executor.c | 39 +++++++++++++++++++++++++++------------ lib/kunit/test.c | 3 ++- 2 files changed, 29 insertions(+), 13 deletions(-)