[PATCH 9/10] blkparse: initialize cpu_map

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---

diff --git a/blkparse.c b/blkparse.c
index 169d491..96ad666 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);


--
To unsubscribe from this list: send the line "unsubscribe linux-btrace" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux