git: 5a6e0e31bc2e - main - sysctl kern.sched.ule.topology_spec: allow to run if ULE is not initialized

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Thu, 29 Jan 2026 18:12:36 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=5a6e0e31bc2e8ed8f655be63fa5b8c41f3d60753

commit 5a6e0e31bc2e8ed8f655be63fa5b8c41f3d60753
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-01-23 15:09:56 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-01-29 18:11:56 +0000

    sysctl kern.sched.ule.topology_spec: allow to run if ULE is not initialized
    
    Reviewed by:    olce
    Tested by:      pho
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D54831
---
 sys/kern/sched_ule.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 7a745619480d..334b3c0f1de3 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -3543,7 +3543,8 @@ sysctl_kern_sched_ule_topology_spec(SYSCTL_HANDLER_ARGS)
 	struct sbuf *topo;
 	int err;
 
-	KASSERT(cpu_top != NULL, ("cpu_top isn't initialized"));
+	if (cpu_top == NULL)
+		return (ENOTTY);
 
 	topo = sbuf_new_for_sysctl(NULL, NULL, 512, req);
 	if (topo == NULL)