diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2017-09-16 02:09:36 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-10-23 15:30:53 -0400 |
commit | 79f56ebe2ae33aa54c69bbc9854a9a31f622913e (patch) | |
tree | b650728be5129fad31b902b5122a50cc224a9537 /tools/perf | |
parent | db49bc155ad9f04ea3c4e1c9ae87850610feb1ce (diff) |
perf kmem: Perform some cleanup if '--time' is given an invalid value
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>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-kmem.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
1983 | 1983 | ||
1984 | if (perf_time__parse_str(&ptime, time_str) != 0) { | 1984 | if (perf_time__parse_str(&ptime, time_str) != 0) { |
1985 | pr_err("Invalid time string\n"); | 1985 | pr_err("Invalid time string\n"); |
1986 | return -EINVAL; | 1986 | ret = -EINVAL; |
1987 | goto out_delete; | ||
1987 | } | 1988 | } |
1988 | 1989 | ||
1989 | if (!strcmp(argv[0], "stat")) { | 1990 | if (!strcmp(argv[0], "stat")) { |