-
Notifications
You must be signed in to change notification settings - Fork 3
Commit c23fcaa
tracing: Switch trace.c code over to use guard()
BugLink: https://bugs.launchpad.net/bugs/2106494
[ Upstream commit d33b10c ]
There are several functions in trace.c that have "goto out;" or
equivalent on error in order to release locks or free values that were
allocated. This can be error prone or just simply make the code more
complex.
Switch every location that ends with unlocking a mutex or freeing on error
over to using the guard(mutex)() and __free() infrastructure to let the
compiler worry about releasing locks. This makes the code easier to read
and understand.
There's one place that should probably return an error but instead return
0. This does not change the return as the only changes are to do the
conversion without changing the logic. Fixing that location will have to
come later.
Cc: Mark Rutland <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Andrew Morton <[email protected]>
Acked-by: Masami Hiramatsu (Google) <[email protected]>
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Steven Rostedt (Google) <[email protected]>
Stable-dep-of: 60b8f71 ("tracing: Have the error of __tracing_resize_ring_buffer() passed to user")
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Noah Wager <[email protected]>
Signed-off-by: Mehmet Basaran <[email protected]>1 parent 4ea7679 commit c23fcaaCopy full SHA for c23fcaa
File tree
Expand file treeCollapse file tree
1 file changed
+94
-172
lines changedFilter options
- kernel/trace
Expand file treeCollapse file tree
1 file changed
+94
-172
lines changed
0 commit comments