From: Taeung Song Date: Wed, 8 Jun 2016 12:36:49 +0000 (+0900) Subject: perf config: Handle NULL at perf_config_set__delete() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=826424cc919529d6d234af12c6ba975b63528a74;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1465389413-8936-2-git-send-email-treeze.taeung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- 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); }