]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ring-buffer: Simplify functions with __free(kfree) to free allocations
authorSteven Rostedt <rostedt@goodmis.org>
Tue, 27 May 2025 18:31:44 +0000 (14:31 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 29 May 2025 12:24:08 +0000 (08:24 -0400)
commit99d232804405e35d7a9af1536a057578a1442e81
treecb24e64a056ccfad4545e94acf4964bec16689ca
parent60bc720e10eac397b3adae975095df77bc368b88
ring-buffer: Simplify functions with __free(kfree) to free allocations

The function rb_allocate_pages() allocates cpu_buffer and on error needs
to free it. It has a single return. Use __free(kfree) and return directly
on errors and have the return use return_ptr(cpu_buffer).

The function alloc_buffer() allocates buffer and on error needs to free
it. It has a single return. Use __free(kfree) and return directly on
errors and have the return use return_ptr(buffer).

The function __rb_map_vma() allocates a temporary array "pages". Have it
use __free() and not worry about freeing it when returning.

Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20250527143144.6edc4625@gandalf.local.home
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c