From: Andrew Price Date: Sat, 26 Apr 2014 02:49:22 +0000 (+0100) Subject: iowatcher: Correct a couple of calloc calls X-Git-Tag: blktrace-1.1.0~2^2~8 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=7f64c1928f85235e01e6f268fdc4cbfc921b5c42;p=blktrace.git iowatcher: Correct a couple of calloc calls (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 --- diff --git a/iowatcher/main.c b/iowatcher/main.c index 92b0ef3..ebbcf3d 100644 --- a/iowatcher/main.c +++ b/iowatcher/main.c @@ -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)