mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-18 14:23:55 +00:00
Make sure we return an error message if the geom parameter is not
located.
This commit is contained in:
parent
c283397793
commit
b61e8fed30
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115958
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue