diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 8755a4370484ec84f4b947efcf81a570ad0297cc..6580e7ed04beb786ebe31e763267718251072470 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -289,6 +289,13 @@ int register_tracer(struct tracer *type)
 			printk(KERN_CONT "FAILED!\n");
 			goto out;
 		}
+		/* Only reset on passing, to avoid touching corrupted buffers */
+		for_each_possible_cpu(i) {
+			data = tr->data[i];
+			if (!head_page(data))
+				continue;
+			tracing_reset(data);
+		}
 		printk(KERN_CONT "PASSED\n");
 	}
 #endif