projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
757be0e
)
axmap: use calloc() for level alloc
author
Jens Axboe
<axboe@kernel.dk>
Sun, 8 Apr 2018 21:42:50 +0000
(15:42 -0600)
committer
Jens Axboe
<axboe@kernel.dk>
Sun, 8 Apr 2018 21:42:50 +0000
(15:42 -0600)
We rely on it being set to NULL for error handling.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/axmap.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/axmap.c
b/lib/axmap.c
index bf203dfe7b2d0ba379ee09b06a6924c3bd00fd03..3c65308cde18e61c116a322fa0b2df6b740cfb16 100644
(file)
--- a/
lib/axmap.c
+++ b/
lib/axmap.c
@@
-102,7
+102,7
@@
struct axmap *axmap_new(unsigned long nr_bits)
}
axmap->nr_levels = levels;
- axmap->levels =
malloc(axmap->nr_levels *
sizeof(struct axmap_level));
+ axmap->levels =
calloc(axmap->nr_levels,
sizeof(struct axmap_level));
axmap->nr_bits = nr_bits;
for (i = 0; i < axmap->nr_levels; i++) {