Commit 99d2328
committed
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>1 parent 60bc720 commit 99d2328
1 file changed
+9
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2226 | 2226 | | |
2227 | 2227 | | |
2228 | 2228 | | |
2229 | | - | |
| 2229 | + | |
2230 | 2230 | | |
2231 | 2231 | | |
2232 | 2232 | | |
| |||
2252 | 2252 | | |
2253 | 2253 | | |
2254 | 2254 | | |
2255 | | - | |
| 2255 | + | |
2256 | 2256 | | |
2257 | 2257 | | |
2258 | 2258 | | |
| |||
2318 | 2318 | | |
2319 | 2319 | | |
2320 | 2320 | | |
2321 | | - | |
| 2321 | + | |
2322 | 2322 | | |
2323 | 2323 | | |
2324 | 2324 | | |
2325 | 2325 | | |
2326 | | - | |
2327 | | - | |
2328 | 2326 | | |
2329 | 2327 | | |
2330 | 2328 | | |
| |||
2359 | 2357 | | |
2360 | 2358 | | |
2361 | 2359 | | |
2362 | | - | |
| 2360 | + | |
2363 | 2361 | | |
2364 | 2362 | | |
2365 | 2363 | | |
| |||
2373 | 2371 | | |
2374 | 2372 | | |
2375 | 2373 | | |
2376 | | - | |
| 2374 | + | |
2377 | 2375 | | |
2378 | 2376 | | |
2379 | 2377 | | |
| |||
2472 | 2470 | | |
2473 | 2471 | | |
2474 | 2472 | | |
2475 | | - | |
| 2473 | + | |
2476 | 2474 | | |
2477 | 2475 | | |
2478 | 2476 | | |
| |||
2484 | 2482 | | |
2485 | 2483 | | |
2486 | 2484 | | |
2487 | | - | |
2488 | | - | |
2489 | 2485 | | |
2490 | 2486 | | |
2491 | 2487 | | |
| |||
7057 | 7053 | | |
7058 | 7054 | | |
7059 | 7055 | | |
7060 | | - | |
| 7056 | + | |
7061 | 7057 | | |
7062 | 7058 | | |
7063 | 7059 | | |
| |||
7125 | 7121 | | |
7126 | 7122 | | |
7127 | 7123 | | |
7128 | | - | |
7129 | | - | |
7130 | | - | |
7131 | | - | |
| 7124 | + | |
| 7125 | + | |
7132 | 7126 | | |
7133 | 7127 | | |
7134 | 7128 | | |
| |||
7143 | 7137 | | |
7144 | 7138 | | |
7145 | 7139 | | |
7146 | | - | |
7147 | | - | |
7148 | | - | |
7149 | 7140 | | |
7150 | 7141 | | |
7151 | 7142 | | |
| |||
0 commit comments