diff mbox series

[1/2] libtracefs synthetic: Remove multiple adding of action in tracefs_synth_save()

Message ID 20240105052141.228999-2-rostedt@goodmis.org (mailing list archive)
State Accepted
Commit fcb3a837577db79bc9a5006c351c992e577a8ff5
Headers show
Series libtracefs sql: A couple of fixes | expand

Commit Message

Steven Rostedt Jan. 5, 2024, 5:21 a.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The tracefs_synth_save() did both:

	*synth->next_action = action;
	synth->next_action = &action->next;

As well as:

	add_action(synth, action);

Which does the same thing. Do not add the action twice, as it causes the action
list to link on itself and create an infinite loop when traversed.

Fixes: 5e5a6cddcced9 ("libtracefs: Add API tracefs_synth_save()")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 src/tracefs-hist.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/src/tracefs-hist.c b/src/tracefs-hist.c
index ecfce7442176..5f32ec305409 100644
--- a/src/tracefs-hist.c
+++ b/src/tracefs-hist.c
@@ -1838,8 +1838,6 @@  int tracefs_synth_save(struct tracefs_synth *synth,
 
 	action->type = ACTION_SAVE;
 	action->handler = type;
-	*synth->next_action = action;
-	synth->next_action = &action->next;
 
 	save = strdup(".save(");
 	if (!save)