linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf tools: util: remove redundant va_end() in strbuf_addv()
@ 2018-12-29 14:17 Mattias Jacobsson
  2019-01-04 15:48 ` Arnaldo Carvalho de Melo
  2019-01-08 15:44 ` [tip:perf/urgent] perf strbuf: Remove " tip-bot for Mattias Jacobsson
  0 siblings, 2 replies; 3+ messages in thread
From: Mattias Jacobsson @ 2018-12-29 14:17 UTC (permalink / raw)
  To: peterz, mingo, acme; +Cc: sansharm, linux-kernel, 2pi

Each call to va_copy() should have one, and only one, corresponding call
to va_end(). In strbuf_addv() some code paths result in va_end() getting
called multiple times. Remove the superfluous va_end().

Fixes: ce49d8436cff ("perf strbuf: Match va_{add,copy} with va_end")
Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
---
 tools/perf/util/strbuf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c
index 9005fbe0780e..23092fd6451d 100644
--- a/tools/perf/util/strbuf.c
+++ b/tools/perf/util/strbuf.c
@@ -109,7 +109,6 @@ static int strbuf_addv(struct strbuf *sb, const char *fmt, va_list ap)
 			return ret;
 		}
 		len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap_saved);
-		va_end(ap_saved);
 		if (len > strbuf_avail(sb)) {
 			pr_debug("this should not happen, your vsnprintf is broken");
 			va_end(ap_saved);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-08 15:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-29 14:17 [PATCH] perf tools: util: remove redundant va_end() in strbuf_addv() Mattias Jacobsson
2019-01-04 15:48 ` Arnaldo Carvalho de Melo
2019-01-08 15:44 ` [tip:perf/urgent] perf strbuf: Remove " tip-bot for Mattias Jacobsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).