mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 16:01:44 -04:00
rtla: Handle pthread_create() failure properly
Add proper error handling when pthread_create() fails to create the timerlat user-space dispatcher thread. Previously, the code only logged an error message but continued execution, which could lead to undefined behavior when the tool later expects the thread to be running. When pthread_create() returns an error, the function now jumps to the out_trace error path to properly clean up resources and exit. This ensures consistent error handling and prevents the tool from running in an invalid state without the required user-space thread. Signed-off-by: Wander Lairson Costa <wander@redhat.com> Link: https://lore.kernel.org/r/20260309195040.1019085-10-wander@redhat.com Signed-off-by: Tomas Glozar <tglozar@redhat.com>
This commit is contained in:
committed by
Tomas Glozar
parent
d6515424e8
commit
d847188bb9
@@ -336,8 +336,10 @@ int run_tool(struct tool_ops *ops, int argc, char *argv[])
|
||||
params->user.cgroup_name = params->cgroup_name;
|
||||
|
||||
retval = pthread_create(&user_thread, NULL, timerlat_u_dispatcher, ¶ms->user);
|
||||
if (retval)
|
||||
if (retval) {
|
||||
err_msg("Error creating timerlat user-space threads\n");
|
||||
goto out_trace;
|
||||
}
|
||||
}
|
||||
|
||||
retval = ops->enable(tool);
|
||||
|
||||
Reference in New Issue
Block a user