* [PATCH for 4.9, 4.14, 4.19] perf strbuf: Remove redundant va_end() in strbuf_addv()
@ 2019-12-24 0:02 Nobuhiro Iwamatsu
2020-01-01 16:50 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Nobuhiro Iwamatsu @ 2019-12-24 0:02 UTC (permalink / raw)
To: stable
From: Mattias Jacobsson <2pi@mok.nu>
commit 099be748865eece21362aee416c350c0b1ae34df upstream.
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().
Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sanskriti Sharma <sansharm@redhat.com>
Link: http://lkml.kernel.org/r/20181229141750.16945-1-2pi@mok.nu
Fixes: ce49d8436cff ("perf strbuf: Match va_{add,copy} with va_end")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
---
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.23.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH for 4.9, 4.14, 4.19] perf strbuf: Remove redundant va_end() in strbuf_addv()
2019-12-24 0:02 [PATCH for 4.9, 4.14, 4.19] perf strbuf: Remove redundant va_end() in strbuf_addv() Nobuhiro Iwamatsu
@ 2020-01-01 16:50 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-01-01 16:50 UTC (permalink / raw)
To: Nobuhiro Iwamatsu; +Cc: stable
On Tue, Dec 24, 2019 at 09:02:03AM +0900, Nobuhiro Iwamatsu wrote:
> From: Mattias Jacobsson <2pi@mok.nu>
>
> commit 099be748865eece21362aee416c350c0b1ae34df upstream.
>
> 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().
>
> Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Sanskriti Sharma <sansharm@redhat.com>
> Link: http://lkml.kernel.org/r/20181229141750.16945-1-2pi@mok.nu
> Fixes: ce49d8436cff ("perf strbuf: Match va_{add,copy} with va_end")
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
> ---
> tools/perf/util/strbuf.c | 1 -
> 1 file changed, 1 deletion(-)
Now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-01 16:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-24 0:02 [PATCH for 4.9, 4.14, 4.19] perf strbuf: Remove redundant va_end() in strbuf_addv() Nobuhiro Iwamatsu
2020-01-01 16:50 ` Greg KH
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).