Skip to content

Commit 5c8c229

Browse files
committed
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()
2 parents d009de7 + 1b0332a commit 5c8c229

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/kthread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ int kthread_affine_preferred(struct task_struct *p, const struct cpumask *mask)
859859
struct kthread *kthread = to_kthread(p);
860860
cpumask_var_t affinity;
861861
unsigned long flags;
862-
int ret;
862+
int ret = 0;
863863

864864
if (!wait_task_inactive(p, TASK_UNINTERRUPTIBLE) || kthread->started) {
865865
WARN_ON(1);
@@ -892,7 +892,7 @@ int kthread_affine_preferred(struct task_struct *p, const struct cpumask *mask)
892892
out:
893893
free_cpumask_var(affinity);
894894

895-
return 0;
895+
return ret;
896896
}
897897

898898
/*

0 commit comments

Comments
 (0)