diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c index 05076e6839382e4d098562f3c42e317d038e971a..97cf4fab564b4ff238ea0e7249a3a6b485e3b089 100644 --- a/tools/perf/util/mmap.c +++ b/tools/perf/util/mmap.c @@ -302,6 +302,8 @@ int perf_mmap__push(struct perf_mmap *md, bool overwrite, return -1; } + size = end - start; + if ((start & md->mask) + size != (end & md->mask)) { buf = &data[start & md->mask]; size = md->mask + 1 - (start & md->mask);