[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240704065213.13559-1-qiang.zhang1211@gmail.com>
Date: Thu, 4 Jul 2024 14:52:13 +0800
From: Zqiang <qiang.zhang1211@...il.com>
To: paulmck@...nel.org,
imran.f.khan@...cle.com,
tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] smp: Fix missed destroy_work_on_stack() calls in smp_call_on_cpu()
For builts with CONFIG_DEBUG_OBJECTS_WORK=y kernels, the sscs.work
defined using INIT_WORK_ONSTACK() will be initialized by
debug_object_init_on_stack() for debug check in __init_work().
This commit therefore invoke destroy_work_on_stack() to free
sscs.work debug objects before smp_call_on_cpu() returns.
Signed-off-by: Zqiang <qiang.zhang1211@...il.com>
---
kernel/smp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/smp.c b/kernel/smp.c
index cc13e73a887c..61f10f982341 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -1135,6 +1135,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;
}
--
2.17.1
Powered by blists - more mailing lists