]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - util.c
util: Remove unnecesary NULL pointer checks when calling sysfs_free()
[thirdparty/mdadm.git] / util.c
diff --git a/util.c b/util.c
index 09c2f6f90e2d36cf709e6b406ec2c56349d70a02..2bcb81fa921a9150aa0ab639f9b68529d61ac1ee 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1191,8 +1191,7 @@ struct supertype *super_by_fd(int fd, char **subarrayp)
                        subarray = xstrdup(subarray);
                }
                strcpy(container, dev);
-               if (sra)
-                       sysfs_free(sra);
+               sysfs_free(sra);
                sra = sysfs_read(-1, container, GET_VERSION);
                if (sra && sra->text_version[0])
                        verstr = sra->text_version;
@@ -1203,8 +1202,7 @@ struct supertype *super_by_fd(int fd, char **subarrayp)
        for (i = 0; st == NULL && superlist[i] ; i++)
                st = superlist[i]->match_metadata_desc(verstr);
 
-       if (sra)
-               sysfs_free(sra);
+       sysfs_free(sra);
        if (st) {
                st->sb = NULL;
                if (subarrayp)