diff --git a/sys/geom/virstor/g_virstor.c b/sys/geom/virstor/g_virstor.c index a180ef287b39..40e25d15a1ec 100644 --- a/sys/geom/virstor/g_virstor.c +++ b/sys/geom/virstor/g_virstor.c @@ -235,6 +235,12 @@ virstor_ctl_stop(struct gctl_req *req, struct g_class *cp) return; } sc = virstor_find_geom(cp, name); + if (sc == NULL) { + gctl_error(req, "Don't know anything about '%s'", name); + g_topology_unlock(); + return; + } + LOG_MSG(LVL_INFO, "Stopping %s by the userland command", sc->geom->name); update_metadata(sc);