]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sched_ext: Fix use of uninitialized variable in scx_bpf_cpuperf_set()
authorAndrea Righi <arighi@nvidia.com>
Wed, 29 Oct 2025 13:08:43 +0000 (14:08 +0100)
committerTejun Heo <tj@kernel.org>
Wed, 29 Oct 2025 15:14:39 +0000 (05:14 -1000)
scx_bpf_cpuperf_set() has a typo where it dereferences the local
variable @sch, instead of the global @scx_root pointer. Fix by
dereferencing the correct variable.

Fixes: 956f2b11a8a4f ("sched_ext: Drop kf_cpu_valid()")
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext.c

index ecb251e883eab336f15a093354a04495ea256426..1a019a7728fb250061c6214ffc8b4cc819024d5d 100644 (file)
@@ -6401,7 +6401,7 @@ __bpf_kfunc void scx_bpf_cpuperf_set(s32 cpu, u32 perf)
 
        guard(rcu)();
 
-       sch = rcu_dereference(sch);
+       sch = rcu_dereference(scx_root);
        if (unlikely(!sch))
                return;