summaryrefslogtreecommitdiff
path: root/rust/kernel/interop/git@git.tavy.me:linux-stable.git
diff options
context:
space:
mode:
authorWander Lairson Costa <wander@redhat.com>2026-03-09 16:46:31 -0300
committerTomas Glozar <tglozar@redhat.com>2026-03-11 15:29:50 +0100
commit99261ccdc0f346b1f21ae3718b2b3c0dd69c04b4 (patch)
tree3539ed01ec97243ea1f882d0f530b2831fb413bb /rust/kernel/interop/git@git.tavy.me:linux-stable.git
parent5b6dc659ad792c72b3ff1be8039ae2945e030928 (diff)
rtla/utils: Fix loop condition in PID validation
The procfs_is_workload_pid() function iterates through a directory entry name to validate if it represents a process ID. The loop condition checks if the pointer t_name is non-NULL, but since incrementing a pointer never makes it NULL, this condition is always true within the loop's context. Although the inner isdigit() check catches the NUL terminator and breaks out of the loop, the condition is semantically misleading and not idiomatic for C string processing. Correct the loop condition from checking the pointer (t_name) to checking the character it points to (*t_name). This ensures the loop terminates when the NUL terminator is reached, aligning with standard C string iteration practices. While the original code functioned correctly due to the existing character validation, this change improves code clarity and maintainability. Signed-off-by: Wander Lairson Costa <wander@redhat.com> Link: https://lore.kernel.org/r/20260309195040.1019085-19-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