util: Remove unnecesary NULL pointer checks when calling sysfs_free()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
This commit is contained in:
Jes Sorensen 2016-03-07 12:04:58 -05:00
parent 6e8d27e77e
commit 15d230f730
1 changed files with 2 additions and 4 deletions

6
util.c
View File

@ -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)