linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mattias Jacobsson <2pi@mok.nu>
To: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>
Cc: <sansharm@redhat.com>, <linux-kernel@vger.kernel.org>, <2pi@mok.nu>
Subject: [PATCH] perf tools: util: remove redundant va_end() in strbuf_addv()
Date: Sat, 29 Dec 2018 15:17:50 +0100	[thread overview]
Message-ID: <20181229141750.16945-1-2pi@mok.nu> (raw)

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


             reply	other threads:[~2018-12-29 14:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-29 14:17 Mattias Jacobsson [this message]
2019-01-04 15:48 ` [PATCH] perf tools: util: remove redundant va_end() in strbuf_addv() Arnaldo Carvalho de Melo
2019-01-08 15:44 ` [tip:perf/urgent] perf strbuf: Remove " tip-bot for Mattias Jacobsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181229141750.16945-1-2pi@mok.nu \
    --to=2pi@mok.nu \
    --cc=acme@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sansharm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).