kunit: fix UAF when run kfence test case test_gfpzero
[linux-2.6-microblaze.git] / lib / kunit / try-catch.c
index be38a2c..6b3d4db 100644 (file)
@@ -78,6 +78,7 @@ void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context)
        if (time_remaining == 0) {
                kunit_err(test, "try timed out\n");
                try_catch->try_result = -ETIMEDOUT;
+               kthread_stop(task_struct);
        }
 
        exit_code = try_catch->try_result;