diff --git a/lib/kunit/debugfs.c b/lib/kunit/debugfs.c index d548750a325ace..b25d214b93e161 100644 --- a/lib/kunit/debugfs.c +++ b/lib/kunit/debugfs.c @@ -212,8 +212,11 @@ void kunit_debugfs_create_suite(struct kunit_suite *suite) err: string_stream_destroy(suite->log); - kunit_suite_for_each_test_case(suite, test_case) + suite->log = NULL; + kunit_suite_for_each_test_case(suite, test_case) { string_stream_destroy(test_case->log); + test_case->log = NULL; + } } void kunit_debugfs_destroy_suite(struct kunit_suite *suite)