One is supposed to pass in a format string containing (at most) one %u
instance. Use fmtcheck() to enforce that at runtime, WARNing and falling
back to a harmless "kthread/%u" in case verification fails.

Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
 kernel/kthread.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/kthread.c b/kernel/kthread.c
index 087d18d771b5..fddfe605632b 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -441,8 +441,8 @@ struct task_struct *kthread_create_on_cpu(int 
(*threadfn)(void *data),
 {
        struct task_struct *p;
 
-       p = kthread_create_on_node(threadfn, data, cpu_to_node(cpu), namefmt,
-                                  cpu);
+       p = kthread_create_on_node(threadfn, data, cpu_to_node(cpu),
+                                  fmtcheck(namefmt, "kthread/%u", 0), cpu);
        if (IS_ERR(p))
                return p;
        kthread_bind(p, cpu);
-- 
2.19.1.6.gbde171bbf5

Reply via email to