diff options
author | guanjing <guanjing@cmss.chinamobile.com> | 2024-11-17 05:51:29 +0300 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2024-12-04 22:47:39 +0300 |
commit | f24d192985cbd6782850fdbb3839039da2f0ee76 (patch) | |
tree | 8f4db010911c26334395cf95d4de162852a74cfb | |
parent | ef7009decc30eb2515a64253791d61b72229c119 (diff) | |
download | linux-f24d192985cbd6782850fdbb3839039da2f0ee76.tar.xz |
sched_ext: fix application of sizeof to pointer
sizeof when applied to a pointer typed expression gives the size of
the pointer.
The proper fix in this particular case is to code sizeof(*cpuset)
instead of sizeof(cpuset).
This issue was detected with the help of Coccinelle.
Fixes: 22a920209ab6 ("sched_ext: Implement tickless support")
Signed-off-by: guanjing <guanjing@cmss.chinamobile.com>
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r-- | tools/sched_ext/scx_central.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/sched_ext/scx_central.c b/tools/sched_ext/scx_central.c index 21deea320bd7..e938156ed0a0 100644 --- a/tools/sched_ext/scx_central.c +++ b/tools/sched_ext/scx_central.c @@ -97,7 +97,7 @@ restart: SCX_BUG_ON(!cpuset, "Failed to allocate cpuset"); CPU_ZERO(cpuset); CPU_SET(skel->rodata->central_cpu, cpuset); - SCX_BUG_ON(sched_setaffinity(0, sizeof(cpuset), cpuset), + SCX_BUG_ON(sched_setaffinity(0, sizeof(*cpuset), cpuset), "Failed to affinitize to central CPU %d (max %d)", skel->rodata->central_cpu, skel->rodata->nr_cpu_ids - 1); CPU_FREE(cpuset); |