iowatcher: Correct a couple of calloc calls
authorAndrew Price <anprice@redhat.com>
Sat, 26 Apr 2014 02:49:22 +0000 (03:49 +0100)
committerChris Mason <clm@fb.com>
Wed, 24 Sep 2014 19:02:09 +0000 (12:02 -0700)
(Caught by Coverity.) tf->gdd_writes and tf->gdd_reads are arrays of
pointers so update their allocations to use the correct element size.

Signed-off-by: Andrew Price <anprice@redhat.com>
iowatcher/main.c

index 92b0ef3a71e94917b73485f34b6ff094b2d03483..ebbcf3db2bd4038f2eca1ba02e7eb65db4367dcd 100644 (file)
@@ -287,8 +287,8 @@ static void setup_trace_file_graphs(void)
                tf->queue_depth_gld = alloc_line_data(tf->min_seconds, tf->max_seconds, tf->stop_seconds);
 
                tf->iop_gld = alloc_line_data(tf->min_seconds, tf->max_seconds, tf->stop_seconds);
-               tf->gdd_writes = calloc(alloc_ptrs, sizeof(struct graph_dot_data));
-               tf->gdd_reads = calloc(alloc_ptrs, sizeof(struct graph_dot_data));
+               tf->gdd_writes = calloc(alloc_ptrs, sizeof(struct graph_dot_data *));
+               tf->gdd_reads = calloc(alloc_ptrs, sizeof(struct graph_dot_data *));
                tf->io_plots_allocated = alloc_ptrs;
 
                if (tf->trace->mpstat_num_cpus == 0)