aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-07-22 03:36:10 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-07-25 21:43:17 -0400
commit2ec5cab604b2bbc5abe7138b537199762bea59ce (patch)
treeebf9c9eee81b198681e523fcebf5ddd9490240e1 /tools/perf/builtin-script.c
parent868a832918f621b7576655c00067f20326ef3931 (diff)
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>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index d430ff42208a..378f76cdf923 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)
2199 2199
2200 s = script_desc__new(name); 2200 s = script_desc__new(name);
2201 if (!s) 2201 if (!s)
2202 goto out_delete_desc; 2202 return NULL;
2203 2203
2204 script_desc__add(s); 2204 script_desc__add(s);
2205 2205
2206 return s; 2206 return s;
2207
2208out_delete_desc:
2209 script_desc__delete(s);
2210
2211 return NULL;
2212} 2207}
2213 2208
2214static const char *ends_with(const char *str, const char *suffix) 2209static const char *ends_with(const char *str, const char *suffix)