]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
util: Remove unnecesary NULL pointer checks when calling sysfs_free()
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 7 Mar 2016 17:04:58 +0000 (12:04 -0500)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 8 Mar 2016 17:19:03 +0000 (12:19 -0500)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
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)