Commit 387dc88c authored by Steven Rostedt's avatar Steven Rostedt Committed by Greg Kroah-Hartman
Browse files

tracing: Switch trace_events_hist.c code over to use guard()

[ Upstream commit 2b36a97a ]

There are a couple functions in trace_events_hist.c that have "goto out" or
equivalent on error in order to release locks that were taken. This can be
error prone or just simply make the code more complex.

Switch every location that ends with unlocking a mutex on error over to
using the guard(mutex)() infrastructure to let the compiler worry about
releasing locks. This makes the code easier to read and understand.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/20241219201345.694601480@goodmis.org


Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Stable-dep-of: 0b4ffbe4 ("tracing: Correct the refcount if the hist/hist_debug file fails to open")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 7de8290a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment