[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-ab6cd0e5276e24403751e0b3b8ed807738a8571f@git.kernel.org>
Date: Fri, 16 Aug 2019 13:59:36 -0700
From: tip-bot for John Keeping <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: tglx@...utronix.de, peterz@...radead.org, hpa@...or.com,
jolsa@...nel.org, alexander.shishkin@...ux.intel.com,
linux-kernel@...r.kernel.org, namhyung@...nel.org,
mingo@...nel.org, khlebnikov@...dex-team.ru, john@...anate.com,
acme@...hat.com
Subject: [tip:perf/core] perf map: Use zalloc for map_groups
Commit-ID: ab6cd0e5276e24403751e0b3b8ed807738a8571f
Gitweb: https://git.kernel.org/tip/ab6cd0e5276e24403751e0b3b8ed807738a8571f
Author: John Keeping <john@...anate.com>
AuthorDate: Thu, 15 Aug 2019 11:01:44 +0100
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 16 Aug 2019 12:25:23 -0300
perf map: Use zalloc for map_groups
In the next commit we will add new fields to map_groups and we need
these to be null if no value is assigned. The simplest way to achieve
this is to request zeroed memory from the allocator.
Signed-off-by: John Keeping <john@...anate.com>
Reviewed-by: Jiri Olsa <jolsa@...nel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: john keeping <john@...anate.com>
Link: http://lkml.kernel.org/r/20190815100146.28842-1-john@metanate.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/map.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 668410b1d426..44b556812e4b 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -636,7 +636,7 @@ bool map_groups__empty(struct map_groups *mg)
struct map_groups *map_groups__new(struct machine *machine)
{
- struct map_groups *mg = malloc(sizeof(*mg));
+ struct map_groups *mg = zalloc(sizeof(*mg));
if (mg != NULL)
map_groups__init(mg, machine);
Powered by blists - more mailing lists