kernel/sched/ext.c:5356 scx_create_rt_helper() warn: 'helper' is an error pointer or valid
From: Dan Carpenter
Date: Fri Feb 21 2025 - 09:09:31 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 334426094588f8179fe175a09ecc887ff0c75758
commit: 41f70d8e16349c65abdc0dd88a7d0ab94e5ce639 kthread: Unify kthread_create_on_cpu() and kthread_create_worker_on_cpu() automatic format
config: powerpc-randconfig-r073-20250221 (https://download.01.org/0day-ci/archive/20250221/202502211941.Z5Lgg2UR-lkp@xxxxxxxxx/config)
compiler: powerpc-linux-gcc (GCC) 14.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202502211941.Z5Lgg2UR-lkp@xxxxxxxxx/
smatch warnings:
kernel/sched/ext.c:5356 scx_create_rt_helper() warn: 'helper' is an error pointer or valid
kernel/sched/ext.c:5357 scx_create_rt_helper() error: 'helper' dereferencing possible ERR_PTR()
vim +/helper +5356 kernel/sched/ext.c
f0e1a0643a59bf Tejun Heo 2024-06-18 5351 static struct kthread_worker *scx_create_rt_helper(const char *name)
f0e1a0643a59bf Tejun Heo 2024-06-18 5352 {
f0e1a0643a59bf Tejun Heo 2024-06-18 5353 struct kthread_worker *helper;
f0e1a0643a59bf Tejun Heo 2024-06-18 5354
f0e1a0643a59bf Tejun Heo 2024-06-18 5355 helper = kthread_create_worker(0, name);
f0e1a0643a59bf Tejun Heo 2024-06-18 @5356 if (helper)
if (!IS_ERR(helper))
f0e1a0643a59bf Tejun Heo 2024-06-18 @5357 sched_set_fifo(helper->task);
f0e1a0643a59bf Tejun Heo 2024-06-18 5358 return helper;
f0e1a0643a59bf Tejun Heo 2024-06-18 5359 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki