From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
kernel-janitors@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 22/24] perf kmem: Perform some cleanup if '--time' is given an invalid value
Date: Mon, 23 Oct 2017 20:47:34 -0300 [thread overview]
Message-ID: <20171023234736.5335-23-acme@kernel.org> (raw)
In-Reply-To: <20171023234736.5335-1-acme@kernel.org>
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
If the string passed in '--time' is invalid, we must do some cleanup
before leaving. As in the other error handling paths of this function.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: kernel-janitors@vger.kernel.org
Fixes: 2a865bd8dddd ("perf kmem: Add option to specify time window of interest")
Link: http://lkml.kernel.org/r/20170916060936.28199-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-kmem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 24ee68ecdd42..d8f25ef8157b 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -1983,7 +1983,8 @@ int cmd_kmem(int argc, const char **argv)
if (perf_time__parse_str(&ptime, time_str) != 0) {
pr_err("Invalid time string\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto out_delete;
}
if (!strcmp(argv[0], "stat")) {
--
2.13.6
next prev parent reply other threads:[~2017-10-23 23:47 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-23 23:47 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 01/24] perf vendor events: Update JSON metrics for Broadwell Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 02/24] perf vendor events: Update JSON metrics for Broadwell Server Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 03/24] perf vendor events: Update JSON metrics for Haswell Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 04/24] perf vendor events: Update JSON metrics for Haswell Server Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 05/24] perf vendor events: Update JSON metrics for IvyBridge Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 06/24] perf vendor events: Update JSON metrics for IvyTown Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 07/24] perf vendor events: Update JSON metrics for JakeTown Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 08/24] perf vendor events: Update JSON metrics for Sandy Bridge Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 09/24] perf vendor events: Update JSON metrics for Skylake Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 10/24] perf vendor events: Update JSON metrics for Skylake Server Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 11/24] perf mmap: Move perf_mmap and methods to separate mmap.[ch] files Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 12/24] perf record: Make record__mmap_read generic Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 13/24] perf mmap: Adopt push method from builtin-record.c Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 14/24] perf tests attr: Make hw events optional Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 15/24] perf list: Fix group description in the man page Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 16/24] perf annotate: Remove arch::cpuid_parse callback Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 17/24] perf tools: Do not check ABI headers in a detached tarball build Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 18/24] perf vendor events: Fix incorrect cmask syntax for some Intel metrics Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 19/24] perf tools: Introduce binary__fprintf() Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 20/24] perf script: Use fprintf like printing uniformly Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 21/24] perf script: Fix error handling path Arnaldo Carvalho de Melo
2017-10-23 23:47 ` Arnaldo Carvalho de Melo [this message]
2017-10-23 23:47 ` [PATCH 23/24] perf namespaces: Add more appropriate set of headers Arnaldo Carvalho de Melo
2017-10-23 23:47 ` [PATCH 24/24] perf vendor events: Add Goldmont Plus V1 event file Arnaldo Carvalho de Melo
2017-10-24 9:13 ` [GIT PULL 00/24] perf/core improvements and fixes Ingo Molnar
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=20171023234736.5335-23-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
/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).