Incremental: 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:07:45 -05:00
parent 15d230f730
commit fe112c9eba
1 changed files with 3 additions and 6 deletions

View File

@ -644,8 +644,7 @@ out:
close(mdfd);
if (policy)
dev_policy_free(policy);
if (sra)
sysfs_free(sra);
sysfs_free(sra);
return rv;
out_unlock:
map_unlock(&map);
@ -989,8 +988,7 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
sizeof(target->uuid)) == 0 &&
sra->array.failed_disks > 0) {
/* This is our target!! */
if (chosen)
sysfs_free(chosen);
sysfs_free(chosen);
chosen = sra;
sra = NULL;
/* skip to end so we don't check any more */
@ -1022,8 +1020,7 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
sra = NULL;
}
next:
if (sra)
sysfs_free(sra);
sysfs_free(sra);
if (st != st2)
free(st2);
if (dl)