sched_ext: Fixes incorrect type in bpf_scx_init()
PATCH 1/1 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]>
Signed-off-by Jiapeng Chong <[email protected]>
--- kernel/sched/ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/ext.c +1 -1
@@ -4952,7 +4952,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 )
Signature · 1 line
2.20.1.7.g153144c
Tejun Heo
AppliedQuoted 8 lines · Jiapeng Chong
The
type_idis 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]>Signed-off-by Jiapeng Chong <[email protected]>
Applied to sched_ext/for-6.11.
Thanks.
Signature · 1 line
tejun