aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/kunit/test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/kunit/test.c b/lib/kunit/test.c
index 3a3d4ebb35dbeb..f95d2093a0aa33 100644
--- a/lib/kunit/test.c
+++ b/lib/kunit/test.c
@@ -697,7 +697,9 @@ static void kunit_init_suite(struct kunit_suite *suite)
kunit_debugfs_create_suite(suite);
suite->status_comment[0] = '\0';
suite->suite_init_err = 0;
- string_stream_clear(suite->log);
+
+ if (suite->log)
+ string_stream_clear(suite->log);
}
bool kunit_enabled(void)