fio: replace malloc+memset with calloc
[fio.git] / engines / solarisaio.c
index 366b72f46de714f410b1a0fd17fedde45e73257c..b2b47fede675c8cef09e4b921297d3e4a6bed27f 100644 (file)
@@ -187,8 +187,7 @@ static int fio_solarisaio_init(struct thread_data *td)
 {
        unsigned int max_depth;
        struct solarisaio_data *sd;
-       sd = malloc(sizeof(*sd));
-       memset(sd, 0, sizeof(*sd));
+       sd = calloc(1, sizeof(*sd));
 
        max_depth = td->o.iodepth;
        if (max_depth > MAXASYNCHIO) {
@@ -197,8 +196,7 @@ static int fio_solarisaio_init(struct thread_data *td)
                                                        max_depth);
        }
 
-       sd->aio_events = malloc(max_depth * sizeof(struct io_u *));
-       memset(sd->aio_events, 0, max_depth * sizeof(struct io_u *));
+       sd->aio_events = calloc(max_depth, sizeof(struct io_u *));
        sd->max_depth = max_depth;
 
 #ifdef USE_SIGNAL_COMPLETIONS