Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fgraph: Make pid_str size match the comment

The comment above buffer mentions sign, 10 bytes width for number and null
terminator, but buffer itself isn't large enough to hold that much data.

This is a cosmetic change, since PID cannot be negative, other than -1.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Link: https://lore.kernel.org/20250617152110.2530-1-a.sadovnikov@ispras.ru
Signed-off-by: Artem Sadovnikov <a.sadovnikov@ispras.ru>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

authored by

Artem Sadovnikov and committed by
Steven Rostedt (Google)
437889b9 d7b8f8e2

+1 -1
+1 -1
kernel/trace/trace_functions_graph.c
··· 513 513 { 514 514 char comm[TASK_COMM_LEN]; 515 515 /* sign + log10(MAX_INT) + '\0' */ 516 - char pid_str[11]; 516 + char pid_str[12]; 517 517 int spaces = 0; 518 518 int len; 519 519 int i;