From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932634AbdJXKTP (ORCPT ); Tue, 24 Oct 2017 06:19:15 -0400 Received: from terminus.zytor.com ([65.50.211.136]:33111 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932270AbdJXKTM (ORCPT ); Tue, 24 Oct 2017 06:19:12 -0400 Date: Tue, 24 Oct 2017 03:16:40 -0700 From: tip-bot for Christophe JAILLET Message-ID: Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, christophe.jaillet@wanadoo.fr, hpa@zytor.com, peterz@infradead.org, acme@redhat.com, tglx@linutronix.de, alexander.shishkin@linux.intel.com Reply-To: peterz@infradead.org, acme@redhat.com, tglx@linutronix.de, alexander.shishkin@linux.intel.com, hpa@zytor.com, christophe.jaillet@wanadoo.fr, linux-kernel@vger.kernel.org, mingo@kernel.org In-Reply-To: <20170916060936.28199-1-christophe.jaillet@wanadoo.fr> References: <20170916060936.28199-1-christophe.jaillet@wanadoo.fr> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf kmem: Perform some cleanup if '--time' is given an invalid value Git-Commit-ID: 79f56ebe2ae33aa54c69bbc9854a9a31f622913e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 79f56ebe2ae33aa54c69bbc9854a9a31f622913e Gitweb: https://git.kernel.org/tip/79f56ebe2ae33aa54c69bbc9854a9a31f622913e Author: Christophe JAILLET AuthorDate: Sat, 16 Sep 2017 08:09:36 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 23 Oct 2017 16:30:53 -0300 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 Cc: Alexander Shishkin Cc: Peter Zijlstra 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 --- 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 24ee68e..d8f25ef 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")) {