[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211012025424.180781-1-davidcomponentone@gmail.com>
Date: Tue, 12 Oct 2021 10:54:24 +0800
From: davidcomponentone@...il.com
To: Viktor.Rosendahl@....de
Cc: rostedt@...dmis.org, colin.king@...onical.com,
davidcomponentone@...il.com, vulab@...as.ac.cn,
linux-kernel@...r.kernel.org, Zeal Robot <zealci@....com.cn>
Subject: [PATCH] Fix application of sizeof to pointer
From: David Yang <davidcomponentone@...il.com>
The coccinelle check report:
"./tools/tracing/latency/latency-collector.c:1541:10-16:
ERROR: application of sizeof to pointer"
Using the "strlen" to fix it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: David Yang <davidcomponentone@...il.com>
---
tools/tracing/latency/latency-collector.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/tracing/latency/latency-collector.c b/tools/tracing/latency/latency-collector.c
index 3a2e6bb781a8..b131007e6c70 100644
--- a/tools/tracing/latency/latency-collector.c
+++ b/tools/tracing/latency/latency-collector.c
@@ -1538,7 +1538,7 @@ static void tracing_loop(void)
mutex_lock(&print_mtx);
check_signals();
write_or_die(fd_stdout, queue_full_warning,
- sizeof(queue_full_warning));
+ strlen(queue_full_warning) + 1);
mutex_unlock(&print_mtx);
}
modified--;
--
2.30.2
Powered by blists - more mailing lists