aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <[email protected]>2015-06-25 14:48:49 -0300
committerArnaldo Carvalho de Melo <[email protected]>2015-06-25 15:15:49 -0300
commit060664f3b9dff37860e48b5158e8429b2467e526 (patch)
treee273fbf81299a72d66f3865697f79750d7f12463
parent27451700dfa01a05cdb4d9d74501536165158034 (diff)
perf tools: Future-proof thread_map allocation size calculation
Signed-off-by: Jiri Olsa <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Andi Kleen <[email protected]> Cc: David Ahern <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/util/thread_map.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index 8c3c3a0751bd..920136dd8c2e 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -22,7 +22,7 @@ static int filter(const struct dirent *dir)
static struct thread_map *thread_map__realloc(struct thread_map *map, int nr)
{
- size_t size = sizeof(*map) + sizeof(pid_t) * nr;
+ size_t size = sizeof(*map) + sizeof(map->map[0]) * nr;
return realloc(map, size);
}