Commit 2ec5cab6 authored by Dan Carpenter's avatar Dan Carpenter Committed by Arnaldo Carvalho de Melo

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: default avatarDan 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@mwandaSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 868a8329
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment