Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1694126 > unrolled thread
| Started by | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| First post | 2017-07-22 09:40 +0200 |
| Last post | 2017-07-26 19:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] perf script: remove some bogus error handling Dan Carpenter <dan.carpenter@oracle.com> - 2017-07-22 09:40 +0200
[tip:perf/core] perf script: Remove some bogus error handling tip-bot for Dan Carpenter <tipbot@zytor.com> - 2017-07-26 19:30 +0200
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2017-07-22 09:40 +0200 |
| Subject | [PATCH] perf script: remove some bogus error handling |
| Message-ID | <u5Xb3-7sM-1@gated-at.bofh.it> |
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> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 83cdc0a61fd6..89ea2bc9b9be 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)
[toc] | [next] | [standalone]
| From | tip-bot for Dan Carpenter <tipbot@zytor.com> |
|---|---|
| Date | 2017-07-26 19:30 +0200 |
| Subject | [tip:perf/core] perf script: Remove some bogus error handling |
| Message-ID | <u7yih-3eE-75@gated-at.bofh.it> |
| In reply to | #1694126 |
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)
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web