linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] libtracefs: Return negative number when tracefs_filter_string_append() fails
Date: Fri, 22 Jul 2022 16:17:32 -0400	[thread overview]
Message-ID: <20220722161732.0c5d7023@gandalf.local.home> (raw)

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

If the field passed into tracefs_filter_string_append() does not match a
field of the event, or if the value is not proper, it fails to append the
filter, but still returns 0 as it was successful.

Return -1 if it fails.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 src/tracefs-filter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tracefs-filter.c b/src/tracefs-filter.c
index 85d0be17f6b7..b16dfadb3aa9 100644
--- a/src/tracefs-filter.c
+++ b/src/tracefs-filter.c
@@ -423,7 +423,8 @@ int tracefs_filter_string_append(struct tep_event *event, char **filter,
 		free(*filter);
 		*filter = str;
 	}
-	return 0;
+
+	return ret;
 }
 
 static int error_msg(char **err, char *str,
-- 
2.35.1


                 reply	other threads:[~2022-07-22 20:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220722161732.0c5d7023@gandalf.local.home \
    --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 NNTP newsgroup(s).