diff options
author | 2025-02-04 11:01:48 -0800 | |
---|---|---|
committer | 2025-02-04 11:01:48 -0800 | |
commit | 5c8c229261f14159b54b9a32f12e5fa89d88b905 (patch) | |
tree | 95097fe23d37ac734d37d950647a1645d01c8799 | |
parent | Merge tag 'livepatching-for-6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching (diff) | |
parent | kthread: Fix return value on kzalloc() failure in kthread_affine_preferred() (diff) | |
download | linux-rng-5c8c229261f14159b54b9a32f12e5fa89d88b905.tar.xz linux-rng-5c8c229261f14159b54b9a32f12e5fa89d88b905.zip |
Merge tag 'kthreads-fixes-2025-02-04' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks
Pull kthreads fix from Frederic Weisbecker:
- Properly handle return value when allocation fails for the preferred
affinity
* tag 'kthreads-fixes-2025-02-04' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks:
kthread: Fix return value on kzalloc() failure in kthread_affine_preferred()
-rw-r--r-- | kernel/kthread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c index 4005b13ebd7f..5dc5b0d7238e 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -859,7 +859,7 @@ int kthread_affine_preferred(struct task_struct *p, const struct cpumask *mask) struct kthread *kthread = to_kthread(p); cpumask_var_t affinity; unsigned long flags; - int ret; + int ret = 0; if (!wait_task_inactive(p, TASK_UNINTERRUPTIBLE) || kthread->started) { WARN_ON(1); @@ -892,7 +892,7 @@ int kthread_affine_preferred(struct task_struct *p, const struct cpumask *mask) out: free_cpumask_var(affinity); - return 0; + return ret; } /* |