From: tip-bot for Dan Carpenter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:perf/core] perf script: Remove some bogus error handling
Date: Wed, 26 Jul 2017 10:24:06 -0700 [thread overview]
Message-ID: <tip-2ec5cab604b2bbc5abe7138b537199762bea59ce@git.kernel.org> (raw)
In-Reply-To: <20170722073610.nnsyiwdcfl6bhn4t@mwanda>
Commit-ID: 2ec5cab604b2bbc5abe7138b537199762bea59ce
Gitweb: http://git.kernel.org/tip/2ec5cab604b2bbc5abe7138b537199762bea59ce
Author: Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Sat, 22 Jul 2017 10:36:10 +0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
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 <dan.carpenter@oracle.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: kernel-janitors@vger.kernel.org
Link: http://lkml.kernel.org/r/20170722073610.nnsyiwdcfl6bhn4t@mwanda
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
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)
prev parent reply other threads:[~2017-07-26 17:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-22 7:36 [PATCH] perf script: remove some bogus error handling Dan Carpenter
2017-07-26 17:24 ` tip-bot for Dan Carpenter [this message]
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=tip-2ec5cab604b2bbc5abe7138b537199762bea59ce@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dan.carpenter@oracle.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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).