All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf script: remove some bogus error handling
@ 2017-07-22  7:36 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-07-22  7:36 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar
  Cc: Arnaldo Carvalho de Melo, Alexander Shishkin, linux-kernel,
	kernel-janitors

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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-26 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-22  7:36 [PATCH] perf script: remove some bogus error handling Dan Carpenter
2017-07-22  7:36 ` Dan Carpenter
2017-07-26 17:24 ` [tip:perf/core] perf script: Remove " tip-bot for Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.