diff options
| author | Wander Lairson Costa <wander@redhat.com> | 2026-03-09 16:46:14 -0300 |
|---|---|---|
| committer | Tomas Glozar <tglozar@redhat.com> | 2026-03-10 10:32:37 +0100 |
| commit | 009a8e681fb003f38dd57a640e11ed826740b5c1 (patch) | |
| tree | 4f9ec2802bc901136c9c2668fbbc312b416342f3 /rust/kernel/interop/git@git.tavy.me:linux-stable.git | |
| parent | 458c9519ab21ea473020c53a50d7d5b1720ded30 (diff) | |
rtla: Exit on memory allocation failures during initialization
Most memory allocations in rtla happen during early initialization
before any resources are acquired that would require cleanup. In these
cases, propagating allocation errors just adds complexity without any
benefit. There's nothing to clean up, and the program must exit anyway.
This patch introduces fatal allocation wrappers (calloc_fatal,
reallocarray_fatal, strdup_fatal) that call fatal() on allocation
failure. These wrappers simplify the code by eliminating unnecessary
error propagation paths.
The patch converts early allocations to use these wrappers in
actions_init() and related action functions, osnoise_context_alloc()
and osnoise_init_tool(), trace_instance_init() and trace event
functions, and parameter structure allocations in main functions.
This simplifies the code while maintaining the same behavior: immediate
exit on allocation failure during initialization. Allocations that
require cleanup, such as those in histogram allocation functions with
goto cleanup paths, are left unchanged and continue to return errors.
Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20260309195040.1019085-2-wander@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Diffstat (limited to 'rust/kernel/interop/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
