Skip to content

Commit 67ab5eb

Browse files
Tom Zanussirostedt
authored andcommitted
tracing: Don't inc err_log entry count if entry allocation fails
tr->n_err_log_entries should only be increased if entry allocation succeeds. Doing it when it fails won't cause any problems other than wasting an entry, but should be fixed anyway. Link: https://lkml.kernel.org/r/cad1ab28f75968db0f466925e7cba5970cec6c29.1643319703.git.zanussi@kernel.org Cc: [email protected] Fixes: 2f754e7 ("tracing: Don't inc err_log entry count if entry allocation fails") Signed-off-by: Tom Zanussi <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 097f1ee commit 67ab5eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/trace/trace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7740,7 +7740,8 @@ static struct tracing_log_err *get_tracing_log_err(struct trace_array *tr)
77407740
err = kzalloc(sizeof(*err), GFP_KERNEL);
77417741
if (!err)
77427742
err = ERR_PTR(-ENOMEM);
7743-
tr->n_err_log_entries++;
7743+
else
7744+
tr->n_err_log_entries++;
77447745

77457746
return err;
77467747
}

0 commit comments

Comments
 (0)