projects
/
blktrace.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbd4bc0
)
btt/unplug_hist: fix bad memset
author
Jens Axboe
<axboe@fb.com>
Tue, 3 May 2016 14:34:50 +0000
(08:34 -0600)
committer
Jens Axboe
<axboe@fb.com>
Tue, 3 May 2016 14:34:50 +0000
(08:34 -0600)
Just replace the malloc/memset with a calloc().
Signed-off-by: Jens Axboe <axboe@fb.com>
btt/unplug_hist.c
patch
|
blob
|
blame
|
history
diff --git
a/btt/unplug_hist.c
b/btt/unplug_hist.c
index 89995ded5297b15c421ca4c6bfec9446d447675b..be16b69c753c46d7c3bbbc4dd26c97f141c193b7 100644
(file)
--- 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;
}