]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
super1: fix Floating point exception
[thirdparty/mdadm.git] / super1.c
index 7bee02659b18adc75ceee99659fdbeaa507e3ce6..70aa1d3d0219735ca991b1a66ba8413a50438a86 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -2717,7 +2717,10 @@ static int write_bitmap1(struct supertype *st, int fd, enum bitmap_update update
 
        init_afd(&afd, fd);
 
-       locate_bitmap1(st, fd, 0);
+       if (locate_bitmap1(st, fd, 0) < 0) {
+               pr_err("Error: Invalid bitmap\n");
+               return -EINVAL;
+       }
 
        if (posix_memalign(&buf, 4096, 4096))
                return -ENOMEM;