aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2011-12-16 13:25:16 -0600
committerJens Axboe <jaxboe@fusionio.com>2012-02-01 13:14:30 +0100
commitcd992d08dae8dca9f46f75506ec9ceb204dc2f39 (patch)
treece0a9c78c0412ba9922886b780d4586d5bcbacd5
parent6da330452fbaa1de7ebba6cddcdfdb343fda94ee (diff)
downloadblktrace-cd992d08dae8dca9f46f75506ec9ceb204dc2f39.tar.gz
blkparse: initialize cpu_map
We malloc'd cpu_map, and then did: cpu_map[CPU_IDX(cpu)] |= (1UL << CPU_BIT(cpu)); ... not sure how that ever worked if cpu_map was not initialized! Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r--blkparse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/blkparse.c b/blkparse.c
index 0f8d135..80b3a71 100644
--- a/blkparse.c
+++ b/blkparse.c
@@ -1962,6 +1962,7 @@ static int check_cpu_map(struct per_dev_info *pdi)
* create a map of the cpus we have traces for
*/
cpu_map = malloc(pdi->cpu_map_max / sizeof(long));
+ memset(cpu_map, 0, sizeof(*cpu_map));
n = rb_first(&rb_sort_root);
while (n) {
__t = rb_entry(n, struct trace, rb_node);