util: Remove unnecesary NULL pointer checks when calling sysfs_free()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
This commit is contained in:
parent
6e8d27e77e
commit
15d230f730
6
util.c
6
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)
|
||||
|
|
Loading…
Reference in New Issue