Skip to content

Commit

Permalink
sched_ext: Fixes incorrect type in bpf_scx_init()
Browse files Browse the repository at this point in the history
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 <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9523
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Jiapeng Chong authored and Tejun Heo committed Jul 15, 2024
1 parent 1edab90 commit 8bb3079
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8bb3079

Please sign in to comment.