diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-02-04 11:01:48 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-02-04 11:01:48 -0800 |
commit | 5c8c229261f14159b54b9a32f12e5fa89d88b905 (patch) | |
tree | 95097fe23d37ac734d37d950647a1645d01c8799 | |
parent | d009de7d54281f5c23d7d82ec5e6e2d54609791a (diff) | |
parent | 1b0332a42656b798bea867631d739de023633ec6 (diff) |
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; } /* |