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>
This commit is contained in:
Jes Sorensen 2012-03-21 08:04:14 +11:00 committed by NeilBrown
parent 308340aa58
commit 65ed615155
1 changed files with 3 additions and 3 deletions

View File

@ -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;