Thread (29 messages) 29 messages, 5 authors, 2021-10-22

Re: [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline exit

From: Peng, ZhihongX <hidden>
Date: 2021-09-06 05:52:04

-----Original Message-----
From: Dmitry Kozlyuk <redacted>
Sent: Wednesday, September 1, 2021 1:52 AM
To: Peng, ZhihongX <redacted>
Cc: olivier.matz@6wind.com; dev@dpdk.org; stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline exit

2021-08-31 10:28 (UTC+0800), zhihongx.peng@intel.com:
quoted
From: Zhihong Peng <redacted>

Malloc cl in the cmdline_stdin_new function, so release in the
cmdline_stdin_exit function is logical, so that cl will not be
released alone.

Fixes: af75078fece3 (first public release)
Cc: stable@dpdk.org

Signed-off-by: Zhihong Peng <redacted>
---
 lib/cmdline/cmdline_socket.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/lib/cmdline/cmdline_socket.c
b/lib/cmdline/cmdline_socket.c index 998e8ade25..ebd5343754 100644
--- a/lib/cmdline/cmdline_socket.c
+++ b/lib/cmdline/cmdline_socket.c
@@ -53,4 +53,5 @@ cmdline_stdin_exit(struct cmdline *cl)
 		return;

 	terminal_restore(cl);
+	cmdline_free(cl);
 }
Now cmdline_free() may not be called after cmdline_stdin_exit().
User code that does so needs to be changed to avoid double-free.
This behavior change must be documented in the release notes.
I'm not sure it should be backported because of the above.
Using the asan tool, I found that many dpdk apps did not call cmdline_free, only one app called.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help