]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smp: Add missing destroy_work_on_stack() call in smp_call_on_cpu()
authorZqiang <qiang.zhang1211@gmail.com>
Thu, 4 Jul 2024 06:52:13 +0000 (14:52 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 10 Jul 2024 20:40:39 +0000 (22:40 +0200)
For CONFIG_DEBUG_OBJECTS_WORK=y kernels sscs.work defined by
INIT_WORK_ONSTACK() is initialized by debug_object_init_on_stack() for
the debug check in __init_work() to work correctly.

But this lacks the counterpart to remove the tracked object from debug
objects again, which will cause a debug object warning once the stack is
freed.

Add the missing destroy_work_on_stack() invocation to cure that.

[ tglx: Massaged changelog ]

Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Link: https://lore.kernel.org/r/20240704065213.13559-1-qiang.zhang1211@gmail.com
kernel/smp.c

index 18483570cc5f45aa507b06ffd3771dc8404f00c8..aaffecdad31975bfbaa0c463c5f6e333852468b8 100644 (file)
@@ -1119,6 +1119,7 @@ int smp_call_on_cpu(unsigned int cpu, int (*func)(void *), void *par, bool phys)
 
        queue_work_on(cpu, system_wq, &sscs.work);
        wait_for_completion(&sscs.done);
+       destroy_work_on_stack(&sscs.work);
 
        return sscs.ret;
 }