Skip to content

Commit

Permalink
bpf: Initialize ret to 0 inside btf_populate_kfunc_set()
Browse files Browse the repository at this point in the history
Kernel test robot reported below error ->

kernel/bpf/btf.c:6718 btf_populate_kfunc_set()
error: uninitialized symbol 'ret'.

Initialize ret to 0.

Fixes: dee872e ("bpf: Populate kfunc BTF ID sets in struct btf")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/bpf/20220219163915.125770-1-jrdr.linux@gmail.com
  • Loading branch information
Souptick Joarder (HPE) authored and Alexei Starovoitov committed Feb 20, 2022
1 parent a33c0c7 commit d0b3822
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/bpf/btf.c
Original file line number Diff line number Diff line change
Expand Up @@ -6706,7 +6706,7 @@ static int btf_populate_kfunc_set(struct btf *btf, enum btf_kfunc_hook hook,
const struct btf_kfunc_id_set *kset)
{
bool vmlinux_set = !btf_is_module(btf);
int type, ret;
int type, ret = 0;

for (type = 0; type < ARRAY_SIZE(kset->sets); type++) {
if (!kset->sets[type])
Expand Down

0 comments on commit d0b3822

Please sign in to comment.