--- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -7734,7 +7734,8 @@ static struct tracing_log_err *get_traci err = kzalloc(sizeof(*err), GFP_KERNEL); if (!err) err = ERR_PTR(-ENOMEM); - tr->n_err_log_entries++; + else + tr->n_err_log_entries++; return err; }