From: Jes Sorensen Date: Mon, 7 Mar 2016 17:04:58 +0000 (-0500) Subject: util: Remove unnecesary NULL pointer checks when calling sysfs_free() X-Git-Tag: mdadm-4.0~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15d230f730f204917aa2a17fb352aa78f4ec9423;p=thirdparty%2Fmdadm.git util: Remove unnecesary NULL pointer checks when calling sysfs_free() Signed-off-by: Jes Sorensen --- diff --git a/util.c b/util.c index 09c2f6f9..2bcb81fa 100644 --- 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)