diff options
author | marcel <marcel@FreeBSD.org> | 2005-09-18 23:54:40 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2005-09-18 23:54:40 +0000 |
commit | c4edd4f5db75011203e2cd66344a1a2b600e8141 (patch) | |
tree | cd2d86533a2e890193090d216cbc185d540ed44c /sys/geom | |
parent | b00bab4473d1ad8864c379bad245e4dac451d2c4 (diff) | |
download | FreeBSD-src-c4edd4f5db75011203e2cd66344a1a2b600e8141.zip FreeBSD-src-c4edd4f5db75011203e2cd66344a1a2b600e8141.tar.gz |
o Don't cause a panic when the control request lacks a verb.
o Don't set the error twice when the named class does not exist.
It causes ioctl(2) to return with error EEXIST.
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_ctl.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/geom/geom_ctl.c b/sys/geom/geom_ctl.c index e67d84b..8186bc7 100644 --- a/sys/geom/geom_ctl.c +++ b/sys/geom/geom_ctl.c @@ -371,7 +371,6 @@ gctl_get_class(struct gctl_req *req, char const *arg) if (!strcmp(p, cp->name)) return (cp); } - gctl_error(req, "Class not found"); return (NULL); } @@ -427,11 +426,16 @@ g_ctl_req(void *arg, int flag __unused) gctl_error(req, "Class not found"); return; } - verb = gctl_get_param(req, "verb", NULL); - if (mp->ctlreq == NULL) + if (mp->ctlreq == NULL) { gctl_error(req, "Class takes no requests"); - else - mp->ctlreq(req, mp, verb); + return; + } + verb = gctl_get_param(req, "verb", NULL); + if (verb == NULL) { + gctl_error(req, "Verb missing"); + return; + } + mp->ctlreq(req, mp, verb); g_topology_assert(); } |