From c47a831cd653fa4ef4979ae7007e60037eddcb37 Mon Sep 17 00:00:00 2001 From: Silvio Fricke Date: Tue, 29 Sep 2015 19:10:36 +0200 Subject: 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 [squashed patches into one] Signed-off-by: David Sterba --- volumes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'volumes.c') diff --git a/volumes.c b/volumes.c index ca50f1ce..83ddd161 100644 --- a/volumes.c +++ b/volumes.c @@ -1968,10 +1968,9 @@ static void split_eb_for_raid56(struct btrfs_fs_info *info, if (raid_map[i] >= BTRFS_RAID5_P_STRIPE) break; - eb = malloc(sizeof(struct extent_buffer) + stripe_len); + eb = calloc(1, sizeof(struct extent_buffer) + stripe_len); if (!eb) BUG(); - memset(eb, 0, sizeof(struct extent_buffer) + stripe_len); eb->start = raid_map[i]; eb->len = stripe_len; -- cgit v1.2.3