diff options
| author | Breno Leitao <leitao@debian.org> | 2026-05-24 18:19:56 +0300 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-05-27 21:22:56 +0300 |
| commit | 611583a76ea97991b0f65ec1ff099eac7fe0bae4 (patch) | |
| tree | 2c9e10e9b439952e87e9dc4b7cde60e0f46f4be9 | |
| parent | 1503043fd75e29ad49c7d506232e272f6951d07d (diff) | |
| download | linux-611583a76ea97991b0f65ec1ff099eac7fe0bae4.tar.xz | |
workqueue: drop spurious '*' from print_worker_info() fn declaration
print_worker_info() declares its local 'fn' as work_func_t * but
worker->current_func has type work_func_t (a function pointer). The
extra level of indirection is wrong and only happens to be harmless
today because every supported Linux architecture has
sizeof(work_func_t) == sizeof(work_func_t *):
copy_from_kernel_nofault() reads the correct number of bytes by
accident, and %ps still resolves the printed address because the
stored value is the function address regardless of declared type.
On any future ABI where sizeof(void (*)()) differs from
sizeof(void *), the nofault copy would transfer the wrong number of
bytes and the subsequent %ps would print an incorrect address.
Match the field type so the intent is explicit and the code does not
silently rely on equal pointer sizes.
Fixes: 3d1cb2059d93 ("workqueue: include workqueue info when printing debug dump of a worker task")
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
| -rw-r--r-- | kernel/workqueue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 9adee917e2bb..35b0c8f4f10f 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -6286,7 +6286,7 @@ EXPORT_SYMBOL_GPL(set_worker_desc); */ void print_worker_info(const char *log_lvl, struct task_struct *task) { - work_func_t *fn = NULL; + work_func_t fn = NULL; char name[WQ_NAME_LEN] = { }; char desc[WORKER_DESC_LEN] = { }; struct pool_workqueue *pwq = NULL; |
