summaryrefslogtreecommitdiff
path: root/super1.c
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2012-03-21 08:00:50 +1100
committerNeilBrown <neilb@suse.de>2012-03-21 08:00:50 +1100
commit2de0b8a2b4d4c0bdc7fbe4caf591a7c160d86da5 (patch)
tree3d9a839956a3b2e4ff0c56b9a535e00b7c934e12 /super1.c
parent1afa9308d2fdc889ab7847ddc9a9aa05ce1e5faa (diff)
match_metadata_desc1(): Use calloc instead of malloc+memset
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/super1.c b/super1.c
index 4da59917..61655ada 100644
--- a/super1.c
+++ b/super1.c
@@ -1408,10 +1408,10 @@ static int load_super1(struct supertype *st, int fd, char *devname)
static struct supertype *match_metadata_desc1(char *arg)
{
- struct supertype *st = malloc(sizeof(*st));
- if (!st) return st;
+ struct supertype *st = calloc(1, sizeof(*st));
+ if (!st)
+ return st;
- memset(st, 0, sizeof(*st));
st->container_dev = NoMdDev;
st->ss = &super1;
st->max_devs = MAX_DEVS;