summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/config.c
diff options
context:
space:
mode:
authorTaeung Song <treeze.taeung@gmail.com>2016-06-08 21:36:49 +0900
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-06-14 09:29:53 -0300
commit826424cc919529d6d234af12c6ba975b63528a74 (patch)
treeceffe3e30a14fe8ad8faf9d94482d03cb68c6e10 /tools/perf/util/config.c
parent2c95afc1e83d93fac3be6923465e1753c2c53b0a (diff)
downloadlinux-826424cc919529d6d234af12c6ba975b63528a74.tar.gz
linux-826424cc919529d6d234af12c6ba975b63528a74.tar.bz2
linux-826424cc919529d6d234af12c6ba975b63528a74.zip
perf config: Handle NULL at perf_config_set__delete()
perf_config_set__delete() purge and free the config set that contains all config key-value pairs. But if the config set (i.e. 'set' variable at the function) is NULL, this is wrong so handle it. Signed-off-by: Taeung Song <treeze.taeung@gmail.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/r/1465389413-8936-2-git-send-email-treeze.taeung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/config.c')
-rw-r--r--tools/perf/util/config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index 8749eca3055f..31e09a4e8862 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -742,6 +742,9 @@ static void perf_config_set__purge(struct perf_config_set *set)
void perf_config_set__delete(struct perf_config_set *set)
{
+ if (set == NULL)
+ return;
+
perf_config_set__purge(set);
free(set);
}