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


Groups > linux.kernel > #1417367

[BUGFIX][PATCH v8 1/5] perf config: Handle the error about NULL at perf_config_set__delete()

From Taeung Song <treeze.taeung@gmail.com>
Newsgroups linux.kernel
Subject [BUGFIX][PATCH v8 1/5] perf config: Handle the error about NULL at perf_config_set__delete()
Date 2016-06-08 14:40 +0200
Message-ID <rHKW6-7x-39@gated-at.bofh.it> (permalink)
References <rHKW5-7x-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

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: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Taeung Song <treeze.taeung@gmail.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);
 }
-- 
2.5.0

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC][PATCH v8 0/5] perf config: Reimplement perf_config() using perf_config_set__inter() Taeung Song <treeze.taeung@gmail.com> - 2016-06-08 14:40 +0200
  [BUGFIX][PATCH v8 1/5] perf config: Handle the error about NULL at perf_config_set__delete() Taeung Song <treeze.taeung@gmail.com> - 2016-06-08 14:40 +0200
  [PATCH v8 2/5] perf config: Bring declarations about config from util/cache.h to util/config.h Taeung Song <treeze.taeung@gmail.com> - 2016-06-08 14:40 +0200
    Re: [PATCH v8 2/5] perf config: Bring declarations about config from  util/cache.h to util/config.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-09 15:40 +0200
      Re: [PATCH v8 2/5] perf config: Bring declarations about config from  util/cache.h to util/config.h Taeung Song <treeze.taeung@gmail.com> - 2016-06-10 08:30 +0200
        Re: [PATCH v8 2/5] perf config: Bring declarations about config from  util/cache.h to util/config.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-10 21:10 +0200
          Re: [PATCH v8 2/5] perf config: Bring declarations about config from  util/cache.h to util/config.h Taeung Song <treeze.taeung@gmail.com> - 2016-06-11 03:00 +0200
  [PATCH v8 3/5] perf config: Reimplement perf_config() using perf_config_set__iter() Taeung Song <treeze.taeung@gmail.com> - 2016-06-08 14:40 +0200
    Re: [PATCH v8 3/5] perf config: Reimplement perf_config() using  perf_config_set__iter() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-09 15:40 +0200
      Re: [PATCH v8 3/5] perf config: Reimplement perf_config() using  perf_config_set__iter() Taeung Song <treeze.taeung@gmail.com> - 2016-06-10 13:00 +0200
    Re: [PATCH v8 3/5] perf config: Reimplement perf_config() using  perf_config_set__iter() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-09 15:50 +0200
      Re: [PATCH v8 3/5] perf config: Reimplement perf_config() using  perf_config_set__iter() Taeung Song <treeze.taeung@gmail.com> - 2016-06-10 13:10 +0200
  [PATCH v8 5/5] perf config: Reimplement show_config() using perf_config_set__iter() Taeung Song <treeze.taeung@gmail.com> - 2016-06-08 14:40 +0200

csiph-web