Commit 3d8669e6 authored by Dan Carpenter's avatar Dan Carpenter Committed by Daniel Borkmann
Browse files

tools/libbpf: signedness bug in btf_dedup_ref_type()



The "ref_type_id" variable needs to be signed for the error handling
to work.

Fixes: d5caef5b ("btf: add BTF types deduplication algorithm")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarAndrii Nakryiko <andriin@fb.com>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 74b38819
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2326,7 +2326,8 @@ static int btf_dedup_ref_type(struct btf_dedup *d, __u32 type_id)
	struct btf_type *t, *cand;
	/* if we don't find equivalent type, then we are representative type */
	__u32 new_id = type_id;
	__u32 h, ref_type_id;
	int ref_type_id;
	__u32 h;

	if (d->map[type_id] == BTF_IN_PROGRESS_ID)
		return -ELOOP;