@@ -6041,6 +6041,12 @@ static void update_last_data(struct trace_array *tr)
if (!(tr->flags & TRACE_ARRAY_FL_BOOT))
return;
+ if (!(tr->flags & TRACE_ARRAY_FL_LAST_BOOT))
+ return;
+
+ /* Only if the buffer has previous boot data clear and update it. */
+ tr->flags &= ~TRACE_ARRAY_FL_LAST_BOOT;
+
/* Reset the module list and reload them */
if (tr->scratch) {
struct trace_scratch *tscratch = tr->scratch;
@@ -6052,9 +6058,6 @@ static void update_last_data(struct trace_array *tr)
module_for_each_mod(save_mod, tr);
}
- if (!(tr->flags & TRACE_ARRAY_FL_LAST_BOOT))
- return;
-
/*
* Need to clear all CPU buffers as there cannot be events
* from the previous boot mixed with events with this boot
@@ -6077,7 +6080,6 @@ static void update_last_data(struct trace_array *tr)
#else
tscratch->kaslr_addr = 0;
#endif
- tr->flags &= ~TRACE_ARRAY_FL_LAST_BOOT;
}
/**