From: Jes Sorensen Date: Mon, 7 Mar 2016 16:54:33 +0000 (-0500) Subject: Manage: Remove unnecessary NULL pointer checks X-Git-Tag: mdadm-4.0~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e8d27e77eb3414eb3c947cbd8820b37c4077e61;p=thirdparty%2Fmdadm.git Manage: Remove unnecessary NULL pointer checks sysfs_free() handles NULL pointers, so remove superfluous NULL pointer checks before calling it. Signed-off-by: Jes Sorensen --- diff --git a/Manage.c b/Manage.c index eae96e1c..414373fe 100644 --- 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) {