From d1422556dbff03e982aeb2faf5893b4363621bee Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 3 May 2016 08:34:50 -0600 Subject: [PATCH] btt/unplug_hist: fix bad memset Just replace the malloc/memset with a calloc(). Signed-off-by: Jens Axboe --- btt/unplug_hist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/btt/unplug_hist.c b/btt/unplug_hist.c index 89995de..be16b69 100644 --- a/btt/unplug_hist.c +++ b/btt/unplug_hist.c @@ -34,11 +34,11 @@ void *unplug_hist_alloc(struct d_info *dip) { struct hist_bkt *hbp; - if (unplug_hist_name == NULL) return NULL; + if (unplug_hist_name == NULL) + return NULL; - hbp = malloc(sizeof(*hbp)); + hbp = calloc(1, sizeof(*hbp)); hbp->dip = dip; - memset(hbp->hist, 0, NBKTS * sizeof(int)); return hbp; } -- 2.25.1