lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250203164855.3699026-1-andriy.shevchenko@linux.intel.com>
Date: Mon,  3 Feb 2025 18:48:55 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Frederic Weisbecker <frederic@...nel.org>,
	linux-kernel@...r.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v1 1/1] kthread: Return the assigned value rather than 0

Recently introduced kthread_affine_preferred() has a bug that the value
of ret variable set but not used. This breaks the compilation with error
(assume default CONFIG_WERROR=y and `make W=1` to run the build):

kernel/kthread.c:862:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]

Fixes: 4d13f4304fa4 ("kthread: Implement preferred affinity")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
 kernel/kthread.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/kthread.c b/kernel/kthread.c
index 4005b13ebd7f..8ab625e996d2 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -889,10 +889,12 @@ int kthread_affine_preferred(struct task_struct *p, const struct cpumask *mask)
 	raw_spin_unlock_irqrestore(&p->pi_lock, flags);
 
 	mutex_unlock(&kthreads_hotplug_lock);
+
+	ret = 0;
 out:
 	free_cpumask_var(affinity);
 
-	return 0;
+	return ret;
 }
 
 /*
-- 
2.43.0.rc1.1336.g36b5255a03ac


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ