Commit 5c8c2292 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'kthreads-fixes-2025-02-04' of...

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()
parents d009de7d 1b0332a4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
}

/*