diff options
author | 2024-12-19 15:12:02 -0500 | |
---|---|---|
committer | 2024-12-26 10:38:36 -0500 | |
commit | c949dfb97443b0aee0cfe138049a17e66bbc62e9 (patch) | |
tree | 853280b3252ce15d8507ac77d5cf3d495a7301aa /scripts/lib/kdoc/kdoc_output.py | |
parent | tracing: Have event_enable_write() just return error on error (diff) | |
download | wireguard-linux-c949dfb97443b0aee0cfe138049a17e66bbc62e9.tar.xz wireguard-linux-c949dfb97443b0aee0cfe138049a17e66bbc62e9.zip |
tracing: Simplify event_enable_func() goto out_free logic
The event_enable_func() function allocates the data descriptor early in
the function just to assign its data->count value via:
kstrtoul(number, 0, &data->count);
This makes the code more complex as there are several error paths before
the data descriptor is actually used. This means there needs to be a
goto out_free; to clean it up.
Use a local variable "count" to do the update and move the data allocation
just before it is used. This removes the "out_free" label as the data can
be freed on the failure path of where it is used.
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.190820140@goodmis.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_output.py')
0 files changed, 0 insertions, 0 deletions