]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Manage: Remove unnecessary NULL pointer checks
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 7 Mar 2016 16:54:33 +0000 (11:54 -0500)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 8 Mar 2016 17:19:03 +0000 (12:19 -0500)
sysfs_free() handles NULL pointers, so remove superfluous NULL pointer
checks before calling it.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Manage.c

index eae96e1ce77217ad477e31a842d7833e3981909d..414373fe6ab2da88557fefffaa981baf01871262 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -119,8 +119,7 @@ int Manage_ro(char *devname, int fd, int readonly)
        }
 out:
 #ifndef MDASSEMBLE
-       if (mdi)
-               sysfs_free(mdi);
+       sysfs_free(mdi);
 #endif
        return rv;
 }
@@ -516,8 +515,7 @@ done:
        map_remove(&map, devnm);
        map_unlock(&map);
 out:
-       if (mdi)
-               sysfs_free(mdi);
+       sysfs_free(mdi);
 
        return rv;
 }
@@ -1164,8 +1162,7 @@ int Manage_remove(struct supertype *tst, int fd, struct mddev_dev *dv,
                                                    "state", "remove");
                        else
                                err = -1;
-                       if (sra)
-                               sysfs_free(sra);
+                       sysfs_free(sra);
                }
        }
        if (err) {