summaryrefslogtreecommitdiffstats
path: root/sys/geom/mirror/g_mirror_ctl.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2005-03-26 16:51:19 +0000
committerpjd <pjd@FreeBSD.org>2005-03-26 16:51:19 +0000
commit90f14e00b7595b7f3f99779c9e29f6163692204f (patch)
tree5a7e6d41bff8b3095d1c9dd98c605245bd56fe86 /sys/geom/mirror/g_mirror_ctl.c
parente148e19ed6cd7d51169e61bab725b77128af9564 (diff)
downloadFreeBSD-src-90f14e00b7595b7f3f99779c9e29f6163692204f.zip
FreeBSD-src-90f14e00b7595b7f3f99779c9e29f6163692204f.tar.gz
Check for return values.
Submitted by: sam Found by: Coverity Prevent analysis tool
Diffstat (limited to 'sys/geom/mirror/g_mirror_ctl.c')
-rw-r--r--sys/geom/mirror/g_mirror_ctl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/geom/mirror/g_mirror_ctl.c b/sys/geom/mirror/g_mirror_ctl.c
index fc3649d..8dc87b6 100644
--- a/sys/geom/mirror/g_mirror_ctl.c
+++ b/sys/geom/mirror/g_mirror_ctl.c
@@ -96,11 +96,19 @@ g_mirror_ctl_configure(struct gctl_req *req, struct g_class *mp)
g_topology_assert();
nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
+ if (nargs == NULL) {
+ gctl_error(req, "No '%s' argument.", "nargs");
+ return;
+ }
if (*nargs != 1) {
gctl_error(req, "Invalid number of arguments.");
return;
}
name = gctl_get_asciiparam(req, "arg0");
+ if (name == NULL) {
+ gctl_error(req, "No 'arg%u' argument.", 0);
+ return;
+ }
sc = g_mirror_find_device(mp, name);
if (sc == NULL) {
gctl_error(req, "No such device: %s.", name);
@@ -111,6 +119,10 @@ g_mirror_ctl_configure(struct gctl_req *req, struct g_class *mp)
return;
}
balancep = gctl_get_asciiparam(req, "balance");
+ if (balancep == NULL) {
+ gctl_error(req, "No '%s' argument.", "balance");
+ return;
+ }
if (strcmp(balancep, "none") == 0)
balance = sc->sc_balance;
else {
OpenPOWER on IntegriCloud