summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/geom/geom_subr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index 51702d2..00bdfcb 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -84,6 +84,12 @@ g_load_class(void *arg, int flag)
mp = hh->mp;
g_free(hh);
g_trace(G_T_TOPOLOGY, "g_load_class(%s)", mp->name);
+ LIST_FOREACH(mp2, &g_classes, class) {
+ KASSERT(mp2 != mp,
+ ("The GEOM class %s already loaded", mp2->name));
+ KASSERT(strcmp(mp2->name, mp->name) != 0,
+ ("A GEOM class named %s is already loaded", mp2->name));
+ }
if (mp->init != NULL)
mp->init(mp);
OpenPOWER on IntegriCloud