Skip to content

Commit 4b8b390

Browse files
Mohamed Khalfellarostedt
authored andcommitted
tracing/histograms: Return an error if we fail to add histogram to hist_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>
1 parent 8a96c02 commit 4b8b390

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/trace/trace_events_hist.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6668,7 +6668,8 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
66686668
goto out_unreg;
66696669

66706670
if (has_hist_vars(hist_data) || hist_data->n_var_refs) {
6671-
if (save_hist_vars(hist_data))
6671+
ret = save_hist_vars(hist_data);
6672+
if (ret)
66726673
goto out_unreg;
66736674
}
66746675

0 commit comments

Comments
 (0)