linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Zanussi <zanussi@kernel.org>
To: rostedt@goodmis.org
Cc: artem.bityutskiy@linux.intel.com, mhiramat@kernel.org,
	linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org
Subject: [PATCH 1/3] tracing: Add missing nest end to synth_event_trace_start() error case
Date: Mon, 10 Feb 2020 17:06:48 -0600	[thread overview]
Message-ID: <20abc444b3eeff76425f895815380abe7aa53ff8.1581374549.git.zanussi@kernel.org> (raw)
In-Reply-To: <cover.1581374549.git.zanussi@kernel.org>
In-Reply-To: <cover.1581374549.git.zanussi@kernel.org>

If the ring_buffer reserve in synth_event_trace_start() fails, the
matching ring_buffer_nest_end() should be called in the error code,
since nothing else will ever call it in this case.

Signed-off-by: Tom Zanussi <zanussi@kernel.org>
---
 kernel/trace/trace_events_hist.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index b3bcfd8c7332..a546ffa14785 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -2043,6 +2043,7 @@ int synth_event_trace_start(struct trace_event_file *file,
 	entry = trace_event_buffer_reserve(&trace_state->fbuffer, file,
 					   sizeof(*entry) + fields_size);
 	if (!entry) {
+		ring_buffer_nest_end(trace_state->buffer);
 		ret = -EINVAL;
 		goto out;
 	}
-- 
2.14.1


  reply	other threads:[~2020-02-10 23:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 23:06 [PATCH 0/3] tracing: Synthetic event fixes and updates Tom Zanussi
2020-02-10 23:06 ` Tom Zanussi [this message]
2020-02-12  3:24   ` [PATCH 1/3] tracing: Add missing nest end to synth_event_trace_start() error case Masami Hiramatsu
2020-02-10 23:06 ` [PATCH 2/3] tracing: Don't return -EINVAL when tracing soft disabled synth events Tom Zanussi
2020-02-12  3:24   ` Masami Hiramatsu
2020-02-12  3:28     ` Steven Rostedt
2020-02-12  5:24       ` Masami Hiramatsu
2020-02-10 23:06 ` [PATCH 3/3] tracing: Consolidate trace() functions Tom Zanussi
2020-02-12  3:36   ` Masami Hiramatsu

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=20abc444b3eeff76425f895815380abe7aa53ff8.1581374549.git.zanussi@kernel.org \
    --to=zanussi@kernel.org \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.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).