diff options
author | Silvio Fricke <silvio.fricke@gmail.com> | 2015-09-29 19:10:36 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-10-21 14:29:26 +0200 |
commit | c47a831cd653fa4ef4979ae7007e60037eddcb37 (patch) | |
tree | 69d07646892cda8a71072e8b7920a6afac6ccaec /mkfs.c | |
parent | 9c89f637a3d754ac401b7b6dabe5c7b8c336f848 (diff) |
btrfs-progs: use calloc instead of malloc+memset
This patch is generated from a coccinelle semantic patch:
identifier t;
expression e;
statement s;
@@
-t = malloc(e);
+t = calloc(1, e);
(
if (!t) s
|
if (t == NULL) s
|
)
-memset(t, 0, e);
Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
[squashed patches into one]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'mkfs.c')
-rw-r--r-- | mkfs.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -668,12 +668,11 @@ static int add_file_items(struct btrfs_trans_handle *trans, * do our IO in extent buffers so it can work * against any raid type */ - eb = malloc(sizeof(*eb) + sectorsize); + eb = calloc(1, sizeof(*eb) + sectorsize); if (!eb) { ret = -ENOMEM; goto end; } - memset(eb, 0, sizeof(*eb) + sectorsize); again: |