sched_ext: Fixes for v6.18-rc6

One low risk and obvious fix:
 
 - scx_enable() was dereferencing error pointer on helper kthread creation
   failure. Fixed.
 -----BEGIN PGP SIGNATURE-----
 
 iIQEABYKACwWIQTfIjM1kS57o3GsC/uxYfJx3gVYGQUCaR9kwQ4cdGpAa2VybmVs
 Lm9yZwAKCRCxYfJx3gVYGUOOAPwKO8inQ9NceKv+7hJomt1IErwqe/S5w5ZHtGa4
 knn/vgD9EEDou5QN1iM6VXd7p1T/R7A0lqAfWAtzjpA9lEOCjAA=
 =8v1T
 -----END PGP SIGNATURE-----

Merge tag 'sched_ext-for-6.18-rc6-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext

Pull sched_ext fix from Tejun Heo:
 "One low risk and obvious fix: scx_enable() was dereferencing an error
  pointer on helper kthread creation failure. Fixed"

* tag 'sched_ext-for-6.18-rc6-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext:
  sched_ext: Fix scx_enable() crash on helper kthread creation failure
pull/1354/merge
Linus Torvalds 2025-11-20 11:04:37 -08:00
commit fd95357fd8
1 changed files with 4 additions and 1 deletions

View File

@ -4479,8 +4479,11 @@ static struct scx_sched *scx_alloc_and_add_sched(struct sched_ext_ops *ops)
goto err_free_gdsqs; goto err_free_gdsqs;
sch->helper = kthread_run_worker(0, "sched_ext_helper"); sch->helper = kthread_run_worker(0, "sched_ext_helper");
if (!sch->helper) if (IS_ERR(sch->helper)) {
ret = PTR_ERR(sch->helper);
goto err_free_pcpu; goto err_free_pcpu;
}
sched_set_fifo(sch->helper->task); sched_set_fifo(sch->helper->task);
atomic_set(&sch->exit_kind, SCX_EXIT_NONE); atomic_set(&sch->exit_kind, SCX_EXIT_NONE);