Skip to content

Commit

Permalink
tracing/histograms: Return an error if we fail to add histogram to hi…
Browse files Browse the repository at this point in the history
…st_vars list

Commit 6018b58 ("tracing/histograms: Add histograms to hist_vars if
they have referenced variables") added a check to fail histogram creation
if save_hist_vars() failed to add histogram to hist_vars list. But the
commit failed to set ret to failed return code before jumping to
unregister histogram, fix it.

Link: https://lore.kernel.org/linux-trace-kernel/20230714203341.51396-1-mkhalfella@purestorage.com

Cc: stable@vger.kernel.org
Fixes: 6018b58 ("tracing/histograms: Add histograms to hist_vars if they have referenced variables")
Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
  • Loading branch information
Mohamed Khalfella authored and rostedt committed Jul 23, 2023
1 parent 8a96c02 commit 4b8b390
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/trace/trace_events_hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -6668,7 +6668,8 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
goto out_unreg;

if (has_hist_vars(hist_data) || hist_data->n_var_refs) {
if (save_hist_vars(hist_data))
ret = save_hist_vars(hist_data);
if (ret)
goto out_unreg;
}

Expand Down

0 comments on commit 4b8b390

Please sign in to comment.