Thread (2 messages) 2 messages, 2 authors, 2025-06-20

Re: [PATCH] fgraph: Make pid_str size match the comment

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date: 2025-06-20 00:30:39
Also in: lkml

On Tue, 17 Jun 2025 15:21:09 +0000
Artem Sadovnikov [off-list ref] wrote:
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.
Looks good to me.

Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Thanks,
quoted hunk ↗ jump to hunk
Signed-off-by: Artem Sadovnikov <redacted>
---
 kernel/trace/trace_functions_graph.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index a8c1f56340680..d789d308ab1de 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -344,7 +344,7 @@ static void print_graph_proc(struct trace_seq *s, pid_t pid)
 {
 	char comm[TASK_COMM_LEN];
 	/* sign + log10(MAX_INT) + '\0' */
-	char pid_str[11];
+	char pid_str[12];
 	int spaces = 0;
 	int len;
 	int i;
-- 
2.43.0

-- 
Masami Hiramatsu (Google) [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help