Skip to contentSkip to conversation

tracing/histograms: Return an error if we fail to add histogram to hist_vars list

PATCH Superseded Mohamed Khalfella 2 participants 2 messages Jul 14, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tracing/histograms: Return an error if we fail to add histogram to hist_vars list

If the code fails to add histogram to hist_vars list, then ret should contain error code before jumping to unregister histogram.

Fixes 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if they have referenced variables")
---
 kernel/trace/trace_events_hist.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/trace/trace_events_hist.c +2 -1
index c8c61381eba4..d06938ae0717 100644
@@ -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;
 	}
 
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 2 lines · On Fri, 14 Jul 2023 19:21:43 +0000 Mohamed Khalfella…

If the code fails to add histogram to hist_vars list, then ret should contain error code before jumping to unregister histogram.

Thanks, but I think I'm going to hold off till rc2 to push this through, to see what else comes in, before I go back into running tests just to get another fix as I send my pull request to Linus! ;-)

-- Steve

Quoted 22 lines
Fixes 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if

they have referenced variables") Signed-off-by: Mohamed Khalfella <[email protected]> ---

 kernel/trace/trace_events_hist.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/kernel/trace/trace_events_hist.c index c8c61381eba4..d06938ae0717 100644

kernel/trace/trace_events_hist.c +2 -1
@@ -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;
 	}