summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Pen <r.peniaev@gmail.com>2016-04-23 13:44:08 +0200
committerJens Axboe <axboe@fb.com>2016-04-25 08:53:16 -0600
commitf6541f75f2822252b057f08e9f5f0c40d4079a8c (patch)
tree95fbcb4026f6fb812f638c3d8a02605a426446e2
parent80c4041b2e7a7d5afb75df563bf51bb27773c095 (diff)
downloadblktrace-f6541f75f2822252b057f08e9f5f0c40d4079a8c.tar.gz
blktrace-f6541f75f2822252b057f08e9f5f0c40d4079a8c.tar.bz2
btreplay: fix memory corruption caused by CPU_ZERO_S
Size should be provided, not cpus number. Signed-off-by: Roman Pen <r.peniaev@gmail.com> Cc: Jens Axboe <axboe@fb.com> Cc: <linux-btrace@vger.kernel.org> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--btreplay/btreplay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/btreplay/btreplay.c b/btreplay/btreplay.c
index 6d19564..2a1525e 100644
--- a/btreplay/btreplay.c
+++ b/btreplay/btreplay.c
@@ -550,7 +550,7 @@ static void pin_to_cpu(struct thr_info *tip)
assert(0 <= tip->cpu && tip->cpu < ncpus);
- CPU_ZERO_S(ncpus, cpus);
+ CPU_ZERO_S(size, cpus);
CPU_SET_S(tip->cpu, size, cpus);
if (sched_setaffinity(getpid(), size, cpus)) {
fatal("sched_setaffinity", ERR_SYSCALL, "Failed to pin CPU\n");