From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751612AbdGZR1o (ORCPT ); Wed, 26 Jul 2017 13:27:44 -0400 Received: from terminus.zytor.com ([65.50.211.136]:33763 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbdGZR1n (ORCPT ); Wed, 26 Jul 2017 13:27:43 -0400 Date: Wed, 26 Jul 2017 10:24:06 -0700 From: tip-bot for Dan Carpenter Message-ID: Cc: alexander.shishkin@linux.intel.com, acme@redhat.com, dan.carpenter@oracle.com, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, peterz@infradead.org, linux-kernel@vger.kernel.org Reply-To: linux-kernel@vger.kernel.org, peterz@infradead.org, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, dan.carpenter@oracle.com, acme@redhat.com, alexander.shishkin@linux.intel.com In-Reply-To: <20170722073610.nnsyiwdcfl6bhn4t@mwanda> References: <20170722073610.nnsyiwdcfl6bhn4t@mwanda> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf script: Remove some bogus error handling Git-Commit-ID: 2ec5cab604b2bbc5abe7138b537199762bea59ce 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: 2ec5cab604b2bbc5abe7138b537199762bea59ce Gitweb: http://git.kernel.org/tip/2ec5cab604b2bbc5abe7138b537199762bea59ce Author: Dan Carpenter AuthorDate: Sat, 22 Jul 2017 10:36:10 +0300 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 25 Jul 2017 22:43:17 -0300 perf script: Remove some bogus error handling If script_desc__new() fails then the current code has a NULL dereference. We don't actually need to do any cleanup, we can just return NULL. Signed-off-by: Dan Carpenter Cc: Alexander Shishkin Cc: Peter Zijlstra Cc: kernel-janitors@vger.kernel.org Link: http://lkml.kernel.org/r/20170722073610.nnsyiwdcfl6bhn4t@mwanda Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-script.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index d430ff4..378f76c 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -2199,16 +2199,11 @@ static struct script_desc *script_desc__findnew(const char *name) s = script_desc__new(name); if (!s) - goto out_delete_desc; + return NULL; script_desc__add(s); return s; - -out_delete_desc: - script_desc__delete(s); - - return NULL; } static const char *ends_with(const char *str, const char *suffix)