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:
parent
21f541cc31
commit
6e8d27e77e
9
Manage.c
9
Manage.c
|
@ -119,8 +119,7 @@ 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,8 +515,7 @@ 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,8 +1162,7 @@ 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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in New Issue