Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools: Future-proof thread_map allocation size calculation

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/20150625174840.GH3253@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+1 -1
+1 -1
tools/perf/util/thread_map.c
··· 22 22 23 23 static struct thread_map *thread_map__realloc(struct thread_map *map, int nr) 24 24 { 25 - size_t size = sizeof(*map) + sizeof(pid_t) * nr; 25 + size_t size = sizeof(*map) + sizeof(map->map[0]) * nr; 26 26 27 27 return realloc(map, size); 28 28 }