diff options
author | Jiapeng Chong <[email protected]> | 2024-07-15 10:10:26 +0800 |
---|---|---|
committer | Tejun Heo <[email protected]> | 2024-07-14 18:10:10 -1000 |
commit | 8bb30798fd6ee79e4041a32ca85b9f70345d8671 (patch) | |
tree | 2b4762ffa8d964602ccb194dfedaba8e4e5891d8 | |
parent | 1edab907b57d42e2dcf4c16a00185a89209e8700 (diff) |
sched_ext: Fixes incorrect type in bpf_scx_init()
The type_id is defined as u32type, if(type_id<0) is invalid, hence
modified its type to s32.
./kernel/sched/ext.c:4958:5-12: WARNING: Unsigned expression compared with zero: type_id < 0.
Reported-by: Abaci Robot <[email protected]>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9523
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
-rw-r--r-- | kernel/sched/ext.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index 03da2cecb547..da9cac6b6cc2 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -5057,7 +5057,7 @@ static void bpf_scx_unreg(void *kdata, struct bpf_link *link) static int bpf_scx_init(struct btf *btf) { - u32 type_id; + s32 type_id; type_id = btf_find_by_name_kind(btf, "task_struct", BTF_KIND_STRUCT); if (type_id < 0) |