summaryrefslogtreecommitdiffstats
path: root/super-ddf.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-05-15 16:48:57 +1000
committerNeil Brown <neilb@suse.de>2008-05-15 16:48:57 +1000
commita2349791da2f2cd33ac84ce2b6d70914a1eed729 (patch)
treea1ad24e367fff2f1d70f5c19041d8f8469d882b3 /super-ddf.c
parent4fa5aef9667535147d3069360a1f1b543fe2b1ea (diff)
downloadmdadm-a2349791da2f2cd33ac84ce2b6d70914a1eed729.tar.gz
mdadm-a2349791da2f2cd33ac84ce2b6d70914a1eed729.tar.xz
mdadm-a2349791da2f2cd33ac84ce2b6d70914a1eed729.zip
Fix some initialisations...
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/super-ddf.c b/super-ddf.c
index 10647f3..91c53da 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -597,6 +597,8 @@ static int load_ddf_global(int fd, struct ddf_super *super, char *devname)
!super->virt) {
free(super->phys);
free(super->virt);
+ super->phys = NULL;
+ super->virt = NULL;
return 2;
}
super->conflist = NULL;
@@ -727,6 +729,7 @@ static int load_super_ddf(struct supertype *st, int fd,
sizeof(*super));
return 1;
}
+ memset(super, 0, sizeof(*super));
rv = load_ddf_headers(fd, super, devname);
if (rv) {
@@ -2251,6 +2254,7 @@ static int load_super_ddf_all(struct supertype *st, int fd,
super = malloc(sizeof(*super));
if (!super)
return 1;
+ memset(super, 0, sizeof(*super));
/* first, try each device, and choose the best ddf */
for (sd = sra->devs ; sd ; sd = sd->next) {