Add a KASSERT to prevent the same GEOM class from being processed loaded

twice.

Enforce that classes should have different names while we are here.
This commit is contained in:
phk 2003-06-04 17:51:10 +00:00
parent 6d070a0d03
commit 1ee949187c

View File

@ -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);