Skip to content

Commit 060664f

Browse files
committed
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]>
1 parent 2745170 commit 060664f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/util/thread_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static int filter(const struct dirent *dir)
2222

2323
static struct thread_map *thread_map__realloc(struct thread_map *map, int nr)
2424
{
25-
size_t size = sizeof(*map) + sizeof(pid_t) * nr;
25+
size_t size = sizeof(*map) + sizeof(map->map[0]) * nr;
2626

2727
return realloc(map, size);
2828
}

0 commit comments

Comments
 (0)