summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_linker.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-03-31 22:49:31 +0000
committerjhb <jhb@FreeBSD.org>2005-03-31 22:49:31 +0000
commit31fedfa192ea7ed8909d31f6a4d1500343faf2ae (patch)
tree02ab30952ddc34b93627c6ac1ec859e3978a344f /sys/kern/kern_linker.c
parent0deac201a88aeb3c40ec379ee92a9c5759182499 (diff)
downloadFreeBSD-src-31fedfa192ea7ed8909d31f6a4d1500343faf2ae.zip
FreeBSD-src-31fedfa192ea7ed8909d31f6a4d1500343faf2ae.tar.gz
- Denote a few places where kobj class references are manipulated without
holding the appropriate lock. - Add a comment explaining why we bump a driver's kobj class reference when loading a module.
Diffstat (limited to 'sys/kern/kern_linker.c')
-rw-r--r--sys/kern/kern_linker.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 49ad88b..53479e1 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -141,13 +141,14 @@ linker_add_class(linker_class_t lc)
{
/*
- * We disallow any class registration passt SI_ORDER_ANY
- * of SI_SUB_KLD.
+ * We disallow any class registration past SI_ORDER_ANY
+ * of SI_SUB_KLD. We bump the reference count to keep the
+ * ops from being freed.
*/
if (linker_no_more_classes == 1)
return (EPERM);
kobj_class_compile((kobj_class_t) lc);
- ((kobj_class_t)lc)->refs++; /* prevent ops being freed */
+ ((kobj_class_t)lc)->refs++; /* XXX: kobj_mtx */
TAILQ_INSERT_TAIL(&classes, lc, link);
return (0);
}
OpenPOWER on IntegriCloud