File 0011-util-Remove-unnecesary-NULL-pointer-checks-when-call.patch of Package mdadm.7129
From 15d230f730f204917aa2a17fb352aa78f4ec9423 Mon Sep 17 00:00:00 2001
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Date: Mon, 7 Mar 2016 12:04:58 -0500
Subject: [PATCH 232/359] util: Remove unnecesary NULL pointer checks when
calling sysfs_free()
References: bsc#1081910
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Coly Li <colyli@suse.de>
---
util.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/util.c b/util.c
index 09c2f6f..2bcb81f 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)
--
2.16.1