Manage: Remove unnecessary NULL pointer checks

sysfs_free() handles NULL pointers, so remove superfluous NULL pointer
checks before calling it.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
This commit is contained in:
Jes Sorensen 2016-03-07 11:54:33 -05:00
parent 21f541cc31
commit 6e8d27e77e
1 changed files with 3 additions and 6 deletions

View File

@ -119,7 +119,6 @@ int Manage_ro(char *devname, int fd, int readonly)
} }
out: out:
#ifndef MDASSEMBLE #ifndef MDASSEMBLE
if (mdi)
sysfs_free(mdi); sysfs_free(mdi);
#endif #endif
return rv; return rv;
@ -516,7 +515,6 @@ done:
map_remove(&map, devnm); map_remove(&map, devnm);
map_unlock(&map); map_unlock(&map);
out: out:
if (mdi)
sysfs_free(mdi); sysfs_free(mdi);
return rv; return rv;
@ -1164,7 +1162,6 @@ int Manage_remove(struct supertype *tst, int fd, struct mddev_dev *dv,
"state", "remove"); "state", "remove");
else else
err = -1; err = -1;
if (sra)
sysfs_free(sra); sysfs_free(sra);
} }
} }