]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
workqueue: wq_watchdog_touch is always called with valid CPU
authorNicholas Piggin <npiggin@gmail.com>
Tue, 25 Jun 2024 11:42:44 +0000 (21:42 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:11:42 +0000 (11:11 +0200)
[ Upstream commit 18e24deb1cc92f2068ce7434a94233741fbd7771 ]

Warn in the case it is called with cpu == -1. This does not appear
to happen anywhere.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/workqueue.c

index 8c7bafbee1b13753d6730d442cedc4e3e725451c..a1665c2e04b463c117870c62dca61cbe1a146b07 100644 (file)
@@ -6458,6 +6458,8 @@ notrace void wq_watchdog_touch(int cpu)
 {
        if (cpu >= 0)
                per_cpu(wq_watchdog_touched_cpu, cpu) = jiffies;
+       else
+               WARN_ONCE(1, "%s should be called with valid CPU", __func__);
 
        wq_watchdog_touched = jiffies;
 }