Linux-Trace-Devel Archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Subject: [PATCH 1/2] libtracefs synthetic: Remove multiple adding of action in tracefs_synth_save()
Date: Fri,  5 Jan 2024 00:21:00 -0500	[thread overview]
Message-ID: <20240105052141.228999-2-rostedt@goodmis.org> (raw)
In-Reply-To: <20240105052141.228999-1-rostedt@goodmis.org>

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


  reply	other threads:[~2024-01-05  5:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05  5:20 [PATCH 0/2] libtracefs sql: A couple of fixes Steven Rostedt
2024-01-05  5:21 ` Steven Rostedt [this message]
2024-01-05  5:21 ` [PATCH 2/2] libtracefs synthetic: Handle hashed name variables Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240105052141.228999-2-rostedt@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).