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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>

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@xxxxxxxxxxx>
---
 src/tracefs-hist.c | 2 --
 1 file changed, 2 deletions(-)

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)
-- 
2.42.0





[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux