mbox series

[0/4] kunit: Fix some bugs in kunit_filter_suites()

Message ID 20230831071655.2907683-1-ruanjinjie@huawei.com (mailing list archive)
Headers show
Series kunit: Fix some bugs in kunit_filter_suites() | expand

Message

Jinjie Ruan Aug. 31, 2023, 7:16 a.m. UTC
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(-)