Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1423802 > unrolled thread

[tip:perf/core] perf config: Handle NULL at perf_config_set__delete()

Started bytip-bot for Taeung Song <tipbot@zytor.com>
First post2016-06-16 10:40 +0200
Last post2016-06-16 10:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [tip:perf/core] perf config: Handle NULL at  perf_config_set__delete() tip-bot for Taeung Song <tipbot@zytor.com> - 2016-06-16 10:40 +0200

#1423802 — [tip:perf/core] perf config: Handle NULL at perf_config_set__delete()

Fromtip-bot for Taeung Song <tipbot@zytor.com>
Date2016-06-16 10:40 +0200
Subject[tip:perf/core] perf config: Handle NULL at perf_config_set__delete()
Message-ID<rKB0e-5XD-35@gated-at.bofh.it>
Commit-ID:  826424cc919529d6d234af12c6ba975b63528a74
Gitweb:     http://git.kernel.org/tip/826424cc919529d6d234af12c6ba975b63528a74
Author:     Taeung Song <treeze.taeung@gmail.com>
AuthorDate: Wed, 8 Jun 2016 21:36:49 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 14 Jun 2016 09:29:53 -0300

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>
---
 tools/perf/util/config.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index 8749eca..31e09a4 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);
 }

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web