Skip to content

Commit

Permalink
perf tools: Future-proof thread_map allocation size calculation
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
acmel committed Jun 25, 2015
1 parent 2745170 commit 060664f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/util/thread_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 060664f

Please sign in to comment.