From: Steven Rostedt <rostedt@goodmis.org>
To: Sasha Levin <sashal@kernel.org>
Cc: mhiramat@kernel.org, mathieu.desnoyers@efficios.com,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: Fix lock imbalance in s_start() memory allocation failure path
Date: Mon, 29 Sep 2025 14:03:24 -0400 [thread overview]
Message-ID: <20250929140230.79c06c22@batman.local.home> (raw)
In-Reply-To: <20250929113238.3722055-1-sashal@kernel.org>
On Mon, 29 Sep 2025 07:32:38 -0400
Sasha Levin <sashal@kernel.org> wrote:
> iff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index 9f3e9537417d5..e00da4182deb7 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -1629,11 +1629,10 @@ static void *s_start(struct seq_file *m, loff_t *pos)
> loff_t l;
>
> iter = kzalloc(sizeof(*iter), GFP_KERNEL);
> + mutex_lock(&event_mutex);
> if (!iter)
> return NULL;
>
> - mutex_lock(&event_mutex);
> -
> iter->type = SET_EVENT_FILE;
> iter->file = list_entry(&tr->events, struct trace_event_file, list);
>
Good catch, thanks!
-- Steve
prev parent reply other threads:[~2025-09-29 18:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-29 11:32 [PATCH] tracing: Fix lock imbalance in s_start() memory allocation failure path Sasha Levin
2025-09-29 18:03 ` Steven Rostedt [this message]
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=20250929140230.79c06c22@batman.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=sashal@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).