diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index 4c8a1b2d8231669326abcd2213a9c711d455ce07..a6f1ed75f8368f04f548d604a1b388b2a2e5637a 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -67,6 +67,8 @@ trace_test_buffer_cpu(struct trace_array *tr, struct trace_array_cpu *data)
 	return 0;
 
  failed:
+	/* disable tracing */
+	tracing_disabled = 1;
 	printk(KERN_CONT ".. corrupted trace buffer .. ");
 	return -1;
 }