diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2026-05-06 20:53:46 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2026-05-06 20:53:46 +0000 |
| commit | 5a6e5954d14b589bcba0125d10a6c7b62b588f4b (patch) | |
| tree | 1418864e3f6cc832bdb207fdf12c3d93c7f421d0 | |
| parent | bf636accdde4bb9af2c6c07af5420dffffd82332 (diff) | |
kobj: Assert class passed to kobj_init_static is compiled
Inspired by discussion in
https://github.com/freebsd/freebsd-src/pull/2016
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D56624
| -rw-r--r-- | sys/kern/subr_kobj.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/subr_kobj.c b/sys/kern/subr_kobj.c index d97834b3fe58..09fd730660c4 100644 --- a/sys/kern/subr_kobj.c +++ b/sys/kern/subr_kobj.c @@ -317,6 +317,8 @@ void kobj_init_static(kobj_t obj, kobj_class_t cls) { + KASSERT(cls->ops != NULL, + ("%s: class %p is not compiled", __func__, cls)); KASSERT(kobj_mutex_inited == 0, ("%s: only supported during early cycles", __func__)); |
