--- a/mm/kfence/kfence_test.c~kfence-test-fail-fast-if-disabled-at-boot +++ a/mm/kfence/kfence_test.c @@ -789,6 +789,9 @@ static int test_init(struct kunit *test) unsigned long flags; int i; + if (!__kfence_pool) + return -EINVAL; + spin_lock_irqsave(&observed.lock, flags); for (i = 0; i < ARRAY_SIZE(observed.lines); i++) observed.lines[i][0] = '\0';