Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1694126
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] perf script: remove some bogus error handling |
| Date | 2017-07-22 09:40 +0200 |
| Message-ID | <u5Xb3-7sM-1@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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)
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[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
csiph-web