diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2012-03-20 22:04:14 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-03-20 22:04:14 +0100 |
commit | 65ed615155cbbe96f37dadc0fd59e8deadd737ef (patch) | |
tree | fbb0eb66dd9af8ba1bbd879507f98efaff6b339a /super0.c | |
parent | Use struct align_fd to cache fd's block size for aligned reads/writes (diff) | |
download | mdadm-65ed615155cbbe96f37dadc0fd59e8deadd737ef.tar.xz mdadm-65ed615155cbbe96f37dadc0fd59e8deadd737ef.zip |
match_metadata_desc0(): 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 'super0.c')
-rw-r--r-- | super0.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -942,10 +942,10 @@ static int load_super0(struct supertype *st, int fd, char *devname) static struct supertype *match_metadata_desc0(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 = &super0; st->info = NULL; |