]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tracing/trigger: Fix to return error if failed to alloc snapshot
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Fri, 26 Jan 2024 00:42:58 +0000 (09:42 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:51:29 +0000 (09:51 +0100)
commit4b001ef14baab16b553a002cb9979e31b8fc0c6b
tree894d1c5a8dc70b202ff861ee22546216ca03213d
parent204eda8c14a7c29f47f117ed01363432163184aa
tracing/trigger: Fix to return error if failed to alloc snapshot

commit 0958b33ef5a04ed91f61cef4760ac412080c4e08 upstream.

Fix register_snapshot_trigger() to return error code if it failed to
allocate a snapshot instead of 0 (success). Unless that, it will register
snapshot trigger without an error.

Link: https://lore.kernel.org/linux-trace-kernel/170622977792.270660.2789298642759362200.stgit@devnote2
Fixes: 0bbe7f719985 ("tracing: Fix the race between registering 'snapshot' event trigger and triggering 'snapshot' operation")
Cc: stable@vger.kernel.org
Cc: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_events_trigger.c