[PATCH 28/38] trace-cmd lib: remove unused tracecmd_parse_cmdlines() function

"Jerome Marchand" <[email protected]>
Newsgroups org.kernel.vger.linux-trace-devel
Message-ID <[email protected]>
Static analysis warned about a possible use-after-free error in
tracecmd_parse_cmdlines() sscanf() fails to match both items. However,
the function seems to not be used at all si we might as well remove it
entirely.

Signed-off-by: Jerome Marchand <[email protected]>
---
 lib/trace-cmd/trace-util.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index a4334a98..37caab45 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -135,23 +135,6 @@ bool tracecmd_get_notimeout(void)
 	return notimeout || debug;
 }
 
-void tracecmd_parse_cmdlines(struct tep_handle *pevent,
-			     char *file, int size __maybe_unused)
-{
-	char *comm;
-	char *line;
-	char *next = NULL;
-	int pid;
-
-	line = strtok_r(file, "\n", &next);
-	while (line) {
-		sscanf(line, "%d %m[^\n]s", &pid, &comm);
-		tep_register_comm(pevent, comm, pid);
-		free(comm);
-		line = strtok_r(NULL, "\n", &next);
-	}
-}
-
 void tracecmd_parse_proc_kallsyms(struct tep_handle *pevent,
 			 char *file, unsigned int size __maybe_unused)
 {
-- 
2.44.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.