From b61e8fed302885ce55db9c8b9149e0a859f056a6 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sat, 7 Jun 2003 15:31:44 +0000 Subject: [PATCH] Make sure we return an error message if the geom parameter is not located. --- sys/geom/geom_ctl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/geom/geom_ctl.c b/sys/geom/geom_ctl.c index 0d6edfd1c886..e135237848ac 100644 --- a/sys/geom/geom_ctl.c +++ b/sys/geom/geom_ctl.c @@ -389,14 +389,14 @@ gctl_get_geom(struct gctl_req *req, struct g_class *mpr, char const *arg) struct g_geom *gp; p = gctl_get_asciiparam(req, arg); - if (p == NULL) - return (NULL); - LIST_FOREACH(mp, &g_classes, class) { - if (mpr != NULL && mpr != mp) - continue; - LIST_FOREACH(gp, &mp->geom, geom) { - if (!strcmp(p, gp->name)) - return (gp); + if (p != NULL) { + LIST_FOREACH(mp, &g_classes, class) { + if (mpr != NULL && mpr != mp) + continue; + LIST_FOREACH(gp, &mp->geom, geom) { + if (!strcmp(p, gp->name)) + return (gp); + } } } gctl_error(req, "Geom not found");