]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
super1: Clear memory allocated for superblock + bitmap before use
[thirdparty/mdadm.git] / super1.c
index d6f3c9362af6fe662583a4aac7b053b167452378..8d5543f7b3aa1f01481b0561709b6966e06ee034 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -2016,6 +2016,8 @@ static int load_super1(struct supertype *st, int fd, char *devname)
                return 1;
        }
 
+       memset(super, 0, SUPER1_SIZE);
+
        if (aread(&afd, super, MAX_SB_SIZE) != MAX_SB_SIZE) {
                if (devname)
                        pr_err("Cannot read superblock on %s\n",