Skip to content

Commit e7ed83d

Browse files
Dan Carpenterborkmann
authored andcommitted
bpf: Fix an error code in check_btf_func()
This code returns success if the "info_aux" allocation fails but it should return -ENOMEM. Fixes: 8c1b6e6 ("bpf: Compare BTF types of functions arguments with actual types") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Song Liu <[email protected]> Link: https://lore.kernel.org/bpf/20200604085436.GA943001@mwanda
1 parent 49b2357 commit e7ed83d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/verifier.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7552,7 +7552,7 @@ static int check_btf_func(struct bpf_verifier_env *env,
75527552
const struct btf *btf;
75537553
void __user *urecord;
75547554
u32 prev_offset = 0;
7555-
int ret = 0;
7555+
int ret = -ENOMEM;
75567556

75577557
nfuncs = attr->func_info_cnt;
75587558
if (!nfuncs)

0 commit comments

Comments
 (0)